Commit graph

63 commits

Author SHA1 Message Date
Alexandre Emsenhuber 417248832f * (bug 22866) Cast returned value to numeric if possible to do the check since ExprParser::doExpression() returns a string, this was causing some bugs since "-0" (string) converted to boolean is "true" 2010-03-18 11:35:28 +00:00
Tim Starling 2a677438fa Revert r62436 and associated parser test. If you really want to make {{#ifexist:foo}} work the same way as [[File:foo]], which is presumably what bug 14779 is getting at, then you should do a proper job of it, and not introduce your own special #ifexist-specific syntax for specifying files. 2010-02-19 07:32:11 +00:00
Platonides f409f3f252 Follow up r62436 comments.
s/Title::newFromUrl/Title::newFromURL/
All these usages should be reviewed. Make it easy to grep using the canonical form.
Additionally fix the typo.
2010-02-13 23:58:30 +00:00
Platonides 9fbeadd46f (Bug 14779) {{#ifexist}} does not recognise URL encoded filenames
Solution provided by Umherirrender
2010-02-13 15:08:25 +00:00
Platonides 54e735a748 Follow-up r61154. Use StringUtils::escapeRegexReplacement() instead of manually replacing the characters. 2010-01-27 11:25:23 +00:00
Platonides df8dcaad5b Follow up r61149. Using preg_quote on $inReplaceTo replaces too much. However, we need to avoid \1 and $1 backreferences, since there won't be any (the user does no regex search, all parenthesis will be escaped). 2010-01-16 23:52:48 +00:00
Sam Reed 9e6fd9432e (bug 22115) Explode: Subject does not need to be quoted.
Apply supplied patch by Christopher Baker
2010-01-16 21:03:38 +00:00
Tim Starling bce79e84cb When $wgLocaltimezone is null, make #timel match the behaviour of {{LOCALTIME}} in trunk: use the server's default timezone instead of UTC. Won't throw E_STRICT after the r60825 change to Setup.php. 2010-01-08 01:51:00 +00:00
Yaron Koren 2aeda8c33d Fixed most of the calls to killMarkers() 2009-06-11 03:05:49 +00:00
Aryeh Gregor aa27785023 Make r51509 work with older MediaWiki versions too
After discussion with Tim.  The back-compat stuff here seems pretty
useless -- why can't people with old versions of MediaWiki just keep the
old feature sets, and upgrade MediaWiki to get new features for
extensions?  We branch extensions for a reason.
2009-06-05 17:14:03 +00:00
Aryeh Gregor 6905775132 Make default values fall through in switch
Bug 19093.  Previously {{#switch:foo|bar|#default=baz}} would behave
differently from {{#switch:foo|#default|bar=baz}}, even though they'd
behave identically if "#default" was replaced by "foo".

I changed switchObj but not switchHook.  In testing, switchObj was the
only method that seemed to be used, and I didn't want to make untested
changes to switchHook, so if that's used, the behavior may remain in
some cases.  It seems like code is duplicated between them -- whatever
the difference is, that should probably be factored out.

This passes all existing parser tests for #switch, of which there are
none, so don't blame me if it breaks something.  ;)
2009-06-05 16:53:59 +00:00
Aryeh Gregor 08bcb1bdc7 Style: "else { if" -> "elseif" 2009-06-05 16:31:43 +00:00
Tim Starling 5d97108615 * Disabled string functions by default with a configuration variable. Outlined my case for doing so.
* Defer loading the bulk of the code until a parser function is actually called. Necessary due to the recent large increase in code size. 
* Fixed the total disregard for parser state and object-oriented data flow in ExtParserFunctions::loadRegex().
2009-06-05 09:53:05 +00:00