This adds a magic word to get the protection expiry for a page for a
given action.
Usage is {{PROTECTIONEXPIRY:action}}.
Bug: T19354
Change-Id: Ia1a20e313781789480dc082bdc7f585c4f0e28df
This doesn't fix all the files under includes/parser -
some of them deserve their own patches.
Bug: T102614
Change-Id: I2fcbc19ee337e1b7db4635b5e5f324c651b4d144
* Urlencode and extension tags don't play nice. The current behaviour
is pretty broken. For example,
{{urlencode:<pre id="one">two</pre>}}
outputs
<pre id="one">two</pre>
which isn't exactly urlencoded.
* Just drop the unexpanded content; anything more seems unsafe. There's
precedent for this already in anchorencode.
* Noticed in the infobox caption for enwiki/%22F%22_Is_for_Fugitive
Change-Id: I0ec5d2fdeb71f762036464f65029afd029e8b4a1
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.
Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.
Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
When #tag is given a tag that it doesn't recognize, re-emit it as a
regular tag instead of giving an error. This allows for it to be used with
transparent tags and HTML tags.
Change-Id: I0ceee8a4fdaf2d3142054a108f445ff06597c31a
Add Parser::fetchCurrentRevisionOfTitle(). By default, this just calls
Revision::newFromTitle, but a callback can be set in ParserOptions that
will override it. Anything that runs as part of a parse should use this
wherever possible.
Bug: 70495
Change-Id: I521f1f68ad819cf0f37e63240806f10c1cceef9c
* Previously the cache size was unbounded and leaky
* Also made MapCacheLRU handle null values properly
Change-Id: Ia02258cf051e1ccf11457c758741b8c7922afe89
Implement the same duplicate-warning logic for DISPLAYTITLE that
DEFAULTSORT currently uses, to catch cases where a newer call overrides an
older one.
Bug: 50449
Change-Id: Ibce776d019aab07fb88fbb89afc5340300735405
We currently allow <ruby>, <rt>, <rb>, and <rp> but not the W3C HTML5
<rtc> element. Fix that.
(Note that <rb> and <rtc> are new additions to HTML5 which currently
appear in the W3C but not the WHATWG version of the HTML5 spec.
Support for these has already been merged in gecko and webkit and
the editor plans to update the WHATWG spec.)
Bug: 67042
Change-Id: I8c0e65d782b6d23057a9723b87323b28e8bf8852
Remaining are the classes containing underscores and possibly a few other
issues that will be addressed soonish.
Change-Id: Icf56374c71afc134420ebbcfecf12dcb29dc9564
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I49f8f48b521878de7abd9cc40efdeff6cf9a37e0
- Added spaces after if/foreach/catch
- Added new line before end of file
- Added or removed spaces before/after parenthesis, comma
- Added spaces around string concat
Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f
and return values accordingly to htmlspecialchars()
PHP Warning: htmlspecialchars() expects parameter 1 to be string,
array given in CoreParserFunctions.php on line 212
Checked for the return value of urlFunction in localurle() and fullurle()
function
Bug: 59881
Change-Id: I7ae092f89b9cfbbe91d1883c2182ca5907825ba4
Makes checks against the fragment easier to read and all the same.
At the moment some using strval, some use type safe comparsion.
Change-Id: I27d9c3e40e6de6800f4488de167cf06e83c88ce6
When a page's cascading protection sources have already been loaded, don't
count CASCADINGSOURCES as expensive.
Change-Id: Ia9d25790c534414f637f85d6a3fc4f2c1c0de790
The pageid parser function (not to be confused with the pageid magic
word) hits the database for every title passed, which meets the criteria
for being considered an expensive parser function.
To mitigate this new expensiveness, check for special namespaces,
interwiki titles, and titles in LinkCache before hitting the DB.
Also, record potentially-valid titles in pagelinks so that the page can
be properly purged if the target is created/deleted.
Change-Id: I4fbfc265543f0a64c14dc8a44e1c89cd928a1adb
When protection levels for a page have not previously loaded, make calls
to PROTECTIONLEVEL for that page count as expensive. Also, add new
accessors for the protection information.
Change-Id: Ic088a9f482154d5353ccf580bbe5c359371a8cdd
The MagicWord raw was not matched against the whole given string, which
result in a raw output, when this was not intented.
Fixing this by adding a new regex, which matches the string from start
to end.
Bug: 56199
Change-Id: I7781c415bd61447dd91872575877dd21f36fae9f
Add {{CASCADINGSOURCES}}, which gives a list of cascading-protected pages
that cause a given page to be protected. This is an expensive parser
function.
Change-Id: I0e9556d53d9a78bc02848c775cb667294726cea1
The {{NAMESPACE}} magic word is broken by the above commit, since it uses
the function name "mwnamespace" in order to not conflict with the PHP 5.3
namespace keyword.
Change-Id: I807c9b89c101db289c0ec47593c18b0d1dc2260b
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