The magic words REVISIONID, REVISIONUSER and REVISIONTIMESTAMP (with
friends) now exists as parser function to fetch revision information
from another page specified as param to the parser function.
Invalid title or non-existing title will return an empty string.
Requesting revision deleted information will always return an empty
string, because this is for public audience and goes into the parser
cache.
The parser function will register a template link to get updated with
refresh jobs on edit of the remote page. This is the same way, than
the parser function pagesize is working.
When the given param is equal to the current title of the parser, the
parser function will yield the previous versions on preview and on
substitution, that includes empty strings when used on page creation,
but using the values from the current version for page view, including
viewing old revisions.
Bug: 6092
Change-Id: Ib15a4e54c65192ec3caef71fd5dcb93fb6fc444e
It's elitist mathematical jargon. In all cases dealt with here, it adds
no additional meaning compared to "if", beyond what was already obvious
from context. Thus, its only purpose is to smugly demonstrate that the
author attended their second-year mathematics classes, at the expense of
causing confusion for everyone who doesn't have such a background.
If you really think you need to convey extra information beyond what
"if" gives you, the English language contains plenty of devices for doing
so, without resorting to neologisms.
Change-Id: Iae21095d02ec2935c10e94f532235c2671c115b1
This avoids giving the own page name to {{PAGESIZE:}} and allows
PAGESIZE on subst: to give the size before save.
Viewing a oldid page will give the corresponding size to that revision.
(Like REVISIONUSER or REVISIONTIMESTAMP)
This partially reverts Idfac13de37d05317f65e4131534543e66cf74873
because there is no need to let PAGESIZE handle extra, when the given
title is the own page.
Change-Id: If9e608d54904c21ac6b095e91ff6e0a15da0fb4c
Corrects inconsistent return value for number of pages in a
category when language variants are in use.
Change-Id: I27668ba348c45bc34b264f8771e91e58a9920552
PHP 5.4 includes some pass-by-reference changes which apparently make
the '&' sigil necessary here.
Spotted by Mormegil <mormegil@centrum.cz>. Followup to Ie162535b.
Change-Id: I038fa7f8e1559c95dba7b9b498fc1d1f5eb76887
{{#special:}} should always return a usable title in NS_SPECIAL,
even when given an unknown special page title. Currently, it returns
"No such special page" text for such unknown names, which is
surprising.
Bug: 47449
Change-Id: I7f184956ec9d56c849f201f1230736fcedd0fadf
$wgRestrictDisplayTitle is intended to make it possible to simply
copy-and-paste the title text even if it requires some styling like
subscript or superscript. Using a <span style="display: none;" />
broke that expectation, as the text hidden in such way becomes
completely invisible and unselectable. This patch rejects such styles.
Also disallowed 'user-select' and 'visibility', since they both
prevent the user from selecting and/or copying the text as well.
Minor changes in Sanitizer:
* checkCss() was made to pass through values which consist of nothing
but a single comment, to allow this rejection to display some sort
of a notification to the user.
* encodeTagAttributes() was added as a counterpart to
decodeTagAttributes(), pulling some code out of fixTagAttributes().
Bug: 26547
Change-Id: Ie162535b6bcbebce4ee69f6dcc1957ccccc3c672
Previously, when parsing {{PAGESIZE:{{FULLPAGENAME}}}} or
{{ {{FULLPAGENAME}} }} (a self-transclusion), we used the
version currently in the db, which is outdated because
the moment we save the page there will be a new version.
This often causes confusion when testing templates that
often have examples of template use in the doc section
which would be one version out of date.
This change causes those variables to give results for
the most recent version of the page. For self-templates
that's done by reparsing the page after save. For
self page sizes this is done by taking the size
of the input to Parser::parse.
Note that {{subst:PAGESIZE:{{subst:FULLPAGENAME}}}}
will still yield previous revision like before.
bug: 39590
Change-Id: Idfac13de37d05317f65e4131534543e66cf74873
Introduced a new variable ROOTPAGENAME which has similar
content like BASEPAGENAME.
ROOTPAGENAME only contains the name of the topmost page without namespace, e.g.
for "User:Name/Article/Subarticle" it should be "Name".
BASEPAGENAME would be "Name/Article" here.
Update : fixed indentation in maintenance/fuzz-tester.php
Added to RELEASE-NOTES-1.2.2
Bug: 6747
Change-Id: I71ef0a15c95c9145462f3aa7fdb3ed11dac79265
CoreParserFunctions::anchorencode incorrectly returns false rather than
the empty string when passed an empty string.
A simple cast fixes it; this likely wasn't noticed before since PHP was
automatically doing the cast anyway when the return value was merged
into wikitext.
Bug: 46608
Change-Id: I97556dbc4dcc1f102f6fed499d43dada388cdc5d
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments
Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
Also moved the retrieval of the revision ID near the one of the
page ID so that the call of ParserOutput::addTemplate() is much
clearer than the actual one.
Change-Id: Ie71ee76e90cc131eac25c0f339d5250d5163ce2e
* Also normalized 0 => false for the rev ID parameter in some places.
* Broke some long lines and shorted a variable name in Skin.php.
Change-Id: I6645315699ec7670ae22aa1dbf787d75d6e6b7ec
Using the same regex like [[File:|]]
With heigth, the width inside the thumb link can be calculated, if the
height not fit in the width.
Change-Id: If188d923d6cd25ea6a5118098f3a513ca5135d43
Add a lang parameter to DateFormatter so it can work in any language instead of only the site content language.
(The memcached key is now per language code.)
Use by default parser->getTargetLanguage() so it is parsed in the page content language by default.
Also add some documentation and remove unneeded whitespace.
If needed, a parameter to {{#dateformatter}} can now be easily added, to specify the language to format in.
Change-Id: If61854920065f7c3b4170ab89e9aa66b299f9dd8
This reused the gender state of a user on a page. This is helpful for
special pages which shows the group name, because the each group name
used gender, which result in often use.
Change-Id: I8e816f54aaa100c3333e84e19299fd194323341d
Also add explicit Title::getPrefixedText() in
CoreParserFunctions::special, so that method does not rely on
Title::toString.
Change-Id: I1d041b11386bff15811e19de47a662e5ed7a2b07
* Introduced Parser::killMarkers() based on the concept from StringFunctions. Used it in cases where markerStripCallback() doesn't make sense semantically, namely grammar, padleft, padright and anchorencode. Used markerStripCallback() in other cases.
* Changed headline unstrip order as suggested by P.Copp on bug 18295
* In CPF::lc() and CPF::uc(), removed the is_callable(). This was a temporary testing hack committed by me in r30109, which allowed me to do differential testing against a copy of the parser from before that revision.
* Reduces the overly long code in r107002, and reduces code for {{#language:}}
* Fixes the language list in Special:Translate which contained languages that gave "invalid code" when selecting