Robin Pepermans
e9033cbf82
Follow-up r106559: it's better to set the preference for own MediaWiki names in Language::getTranslatedLanguageNames. More consistent and saves some code :)
...
Also update Babel to use that function.
2011-12-18 17:58:47 +00:00
Robin Pepermans
8cae5ee72d
Make the output consistent when no second parameter is given and second parameter equals first parameter. This gives preference to names defined in MediaWiki, but when it is not in MediaWiki, it also sees whether there is one defined in the translated language names.
2011-12-18 12:17:12 +00:00
Brian Wolff
4df8e9d595
Throw an exception if Parser::disableCache is called before mOutput initialized (Aka when not parsing something).
...
So far I've encountered 2 extensions that give fatal errors from calling $wgParser->disableOutput() from hooks that are called at points where parsing is not taking place! Exception with a backtrace is much nicer than "Fatal error: Call to a member function disableCache() on a non-object..."
2011-12-15 07:17:29 +00:00
Jeroen De Dauw
49cdca93be
add missing deprecation notices and added deprecation version to existing ones
2011-12-13 05:19:05 +00:00
Jeroen De Dauw
4544a78316
rem use of escapeLocalURL
2011-12-13 04:58:48 +00:00
Alexandre Emsenhuber
2629c3649f
* Added revision's timestamp to OutputPage along with revision ID; avoid a DB hit in Skin::lastModified() when showing parser cache's content. This changed with the removal of $wgArticle in Skin since now it's a different WikiPage object and thus WikiPage::setTimetstamp() call is useless (but still kept).
...
* Added ParserOutput::(get|set)Timestamp() and the $mTimestamp member; avoid messing with isset()
2011-12-10 16:30:40 +00:00
Tim Starling
71e27e22de
* Revert r103476, r105161 and implement the fix for bug 32858 (a.k.a. bug 32450) in WikiPage instead. See comment 14 for further rationale.
...
* Clarified release notes. Please write what the new code does, not the bug description.
2011-12-09 10:32:55 +00:00
Chad Horohoe
a1f5c6ce73
Minor tweaks to cleanSig(inSig)
...
* Make cleanSig public, since it's a declared entry point per class docs
* Make cleanSigInSig public static, added 2 more test cases for it
2011-12-06 23:07:13 +00:00
Antoine Musso
144ffcc01a
allow bold in TOC lines
...
just like r102179 allowed italics in TOC lines for bug 26375, this
patch allow bold text as well.
2011-12-06 10:50:47 +00:00
Antoine Musso
7fc6a7aae0
Skip replaceInternalLinks2 for js/css pages
...
Just skip the whole replaceInternalLinks2 parser function whenever we hit
js/css pages. Previous patch r103476 only handled Category links which was
not enough.
2011-12-05 10:14:40 +00:00
John Du Hart
51a6eadec1
Followup r103817, updating setLang usages
2011-11-23 10:28:21 +00:00
Brion Vibber
d60063eac2
Revert r103795 -- adds <dws> pseudotag which modifies preprocessor behavior in some way to eat whitespace
...
Not sure whether this is something we want, but it should probably be talked over first.
2011-11-23 00:30:13 +00:00
John Du Hart
216d661d3b
Bug 29524 - Rename RequestContext::getLang to getLanguage
...
I'll be amazed if this doens't break any tests.
2011-11-21 16:13:21 +00:00
Mark A. Hershberger
5bd4f88169
Fixes Bug 31865 - Tag <dws> for discarding whitespaces.
...
Patch with parser tests from Van de Bugger
2011-11-21 01:45:23 +00:00
Antoine Musso
78562bd14c
(bug 32450) MediaWiki: .js|.css pages parsed [[Category:#]] links
...
This patch skip the [[Category:#]] parsing logic when the Title is in
NS_MEDIAWIKI and ends with .js or .css. This way the code is kept as is
and pages are no more categorized.
How to reproduce the issue:
$ echo 'var foo = "[[Category:bug32450]]"' \
| php maintenance/parse.php --title MediaWiki:Foobar.js
<p>var foo = ""
</p>
$
Note how the text got stripped.
After this patch:
$ echo 'var foo = "[[Category:bug32450]]"' \
| php maintenance/parse.php --title MediaWiki:Foobar.js
<p>var foo = "[[Category:bug32450]]"
</p>
$
TEST PLAN:
==========
$ php parserTests.php --quiet
This is MediaWiki version 1.19alpha (r103473).
Reading tests from "tests/parser/parserTests.txt"...
Reading tests from "tests/parser/extraParserTests.txt"...
Passed 654 of 654 tests (100%)... ALL TESTS PASSED!
$
2011-11-17 16:46:45 +00:00
Sam Reed
62491fef13
Comments, braces, explicit member variables
...
Remove a couple of unused variables
2011-11-16 13:22:03 +00:00
Sam Reed
2849f384d4
Bug 31995 - Addition of PPFrame::getTitle
...
Applied patch by Van de Bugger
Added documentation to go with
Added code to Preprocess_HipHop too
2011-11-09 20:52:24 +00:00
Platonides
528a450f68
Attempt to fix translatewiki bug 32057
...
The different Preprocessor::newChild expect false (with strict comparison) if there's no title passed to them.
2011-11-08 20:58:57 +00:00
Antoine Musso
30fc9f2913
update ParserCache debug message
...
"Found." was not very helpfull when indicating we found a cached
ParserOutput object.
2011-11-08 09:08:15 +00:00
Platonides
c77380f9c2
Bug 26375 - Italics should be passed to TOC
...
http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_%28technical%29&oldid=403630551#Italics_in_ToC
2011-11-06 15:07:34 +00:00
Aaron Schulz
6c4360c951
Make use of Title::isSpecialPage() in various places
2011-11-02 20:55:08 +00:00
Platonides
dc38ecd003
Bug 31098: Template loop through MediaWiki: messages (int: function) not being detected.
...
The trick is not to replaceVariables() ourselves, but to leave that to the preprocessor,
which is then correctly detecting the loop.
2011-10-29 22:22:51 +00:00
Sam Reed
9d41b95053
Kill various unused variables
...
Comment some out also
Add some bits of documentation
2011-10-29 01:17:26 +00:00
Aaron Schulz
7377d6c080
Added pfunc profiling to braceSubstitution()
2011-10-27 21:53:37 +00:00
Platonides
d581e9dd5a
Removal of unused globals
2011-10-27 20:48:09 +00:00
Aaron Schulz
9a932c4bc8
Fixed braceSubstitution() to only profile templates rather than all kinds of possibly long strings of text to parse. It was dumping the whole text as the name of the profiling entry.
2011-10-27 01:19:34 +00:00
Platonides
8d0c01d751
If the page contains __NOEDITSECTION__, it will never have edit sections, so don't create markers. Follow-up r99250.
...
Fix for bug 31647: Regression: __NOEDITSECTION__ is ignored when the page is read from the parser cache
2011-10-25 22:18:33 +00:00
Alexandre Emsenhuber
f05d7ee8ee
Unstub $wgLang if still stubbed before storing it; avoid storing a StubUserLang instance in ParserOptions and errors when getting the object (per report of Lockal on IRC)
2011-10-25 18:14:30 +00:00
Alexandre Emsenhuber
0ba7a5f510
* (bug 31921) Fix for r78201: magic words REVISIONDAY, REVISIONMONTH and REVISIONYEAR now give current values on preview
2011-10-24 16:14:49 +00:00
Mark A. Hershberger
4bd08afcb7
Revert r100262 — wasn't the right place for it and other problems,
...
like broken parser tests.
Please read [[Manual:Pre-commit checklist]] before committing.
2011-10-19 20:01:50 +00:00
Mark A. Hershberger
fdb4ccd5d2
Give a clear error message instead of un-intelligible UNIQ.*QINU
...
markers.
Not sure the preg_match() is actually needed. Or it may be
appropriate to use MARKER_SUFFIX for the match.
The error message may also need to be rewritten to be more
user-friendly, but I'm pretty sure *an* error message is friendlier
than UNIQ garbage. And making them visible error messages makes them
easier to be found.
2011-10-19 19:34:56 +00:00
Alexandre Emsenhuber
d491ae56a7
Follow-up r100227:
...
* Missed one call to ParserOptions::getUserLang() in Parser
* Also convert RefreshLinksJob and RefreshLinksJob2 to use ParserOptions::newFromUserAndLang() and pass $wgContLang instead of whatever $wgLang could be
2011-10-19 15:30:02 +00:00
Alexandre Emsenhuber
bd548f36e9
* Changed ParserOptions to store a Language object instead of only a string, avoids object -> string -> object conversion
...
* ParserOptions::getUserLang() will still return a string for compatibility, added ParserOptions::getUserLangObj() to get the object
* Added ParserOptions::newFromUserAndLang() and ParserOptions::newFromContext() to easily get a ParserOptions object when a context is available or when someone wants to force the language
* Updated OutputPage and Preferences to use newFromContext() and WikiPage to use newFromUserAndLang()
* ParserOptions::setUserLang() still accepts either a string or a Language object, but changed the calls to pass an object instead of a string
* Changed Parser::getFunctionLang() to return the Language object from ParserOptions when parsing interface messages rather than $wgLang directly and updated the documentation to say that $wgLang should not be used directly (as $wgUser, $wgTitle and $wgRequest)
2011-10-19 14:16:01 +00:00
Sam Reed
27665d27ae
Update some deprecated code
...
Documentation
Fix "/*" comments to "/**"
Flesh out some missing returns, change some return types
2011-10-14 21:18:38 +00:00
Platonides
924d12407e
We don't need anything from the marker. The title is outside.
2011-10-07 21:05:22 +00:00
Platonides
570b984533
Forgot to commit this file in r99250.
2011-10-07 21:00:06 +00:00
Platonides
4d065bb19f
Bug 31445: "Section edit links do not show"
...
Always generate the mw:editsection placeholders.
Remove them if not used.
Update the ParserOutput if fetching from ParserCache
2011-10-07 20:50:10 +00:00
Tim Starling
d6bae9f79c
Fix for bug 31374: reintroduce recursive unstrip as in r27667, somehow omitted during the refactor in r82645. StripState::merge() is still wrong, but it's currently unused on Wikimedia, so this will do as a temporary patch.
2011-10-06 00:07:45 +00:00
Sam Reed
937fc3bcfd
Back out r95396 and friends
2011-09-29 22:08:00 +00:00
Aaron Schulz
87c7cf57f8
FU r98412: added version to wfDeprecated call
2011-09-29 21:30:00 +00:00
Alexandre Emsenhuber
1e94b1be89
Per Aaron, follow-up r96859: add @deprecated comment, a wfDeprecated() and mark it for removal in next version since it's not used anywhere
2011-09-29 15:21:54 +00:00
Alexandre Emsenhuber
0a45e7dc76
Per Aaron, follow-up r93758: add coments and fix typos
2011-09-29 15:14:34 +00:00
Chad Horohoe
c7e950e474
Also add $wgRequest to the forbidden globals...thought it was common sense.
2011-09-27 18:56:44 +00:00
Roan Kattouw
dc4ab75a51
Fix stupid typo in r98193, thanks Dantman
2011-09-26 23:16:32 +00:00
Roan Kattouw
95e857198b
(bug 31176) {{SERVERNAME}} doesn't play nice with protocol-relative URLs
2011-09-26 23:14:20 +00:00
Robin Pepermans
07dc087494
Re-do r96798 ("LanguageConverter now depends on the page content language"), without the change in WikiPage which caused an infinite loop (see bug 31098)
2011-09-22 20:31:23 +00:00
Robin Pepermans
20edfc8ee3
* follow-up r97636: decrease indentation & mention revision per Nikerabbit
...
* add @since for r97071
2011-09-21 19:30:08 +00:00
Robin Pepermans
4f0d606069
r97636: ParserCache meant to be committed already too
2011-09-20 15:58:01 +00:00
Robin Pepermans
3fc94ebd11
Re-do several things of r96798 in preparation of re-doing the rest (there's a bug somewhere that needs fixing).
...
* Do additional validation and is_array() check in LanguageConverter
* Make redirects be in content language again (remove from Title->getPageLanguage())
* Pass title object from ParserCache to ParserOptions->optionsHash
2011-09-20 15:55:08 +00:00
Niklas Laxström
c49610741d
Added LinkCache::addGoodLinkObjFromRow, since addGoodLinkObj is not going to work much longer when new parameters are added
2011-09-20 15:19:18 +00:00