Commit graph

788 commits

Author SHA1 Message Date
Sam Reed
9990b77058 Add missing wfProfileOut( __METHOD__ ); 2012-02-16 02:01:00 +00:00
Antoine Musso
73247df204 Remove backslash from @return types
Ping r111103
2012-02-13 16:35:59 +00:00
Antoine Musso
d5d1585900 revert r111234 (deprecated methods removal)
Reasons invoked by Rob Lanphier are:
* ongoing code slush
* backwards compatilibility issues
2012-02-12 19:25:28 +00:00
Alexandre Emsenhuber
435c7eb616 Remove some methods marked for removal in 1.20 and update FakeTitle accordingly.
No more callers in core or extensions.
2012-02-11 14:36:36 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
2ec09c5165 More return documentation 2012-02-09 21:35:05 +00:00
Sam Reed
0a626db6e1 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:29:36 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Sam Reed
f3cc77aaee Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:41:50 +00:00
Tim Starling
a444986c45 * Optimise {{GENDER}} so that it doesn't need to load the user options if only one form is given. For some reason (presumably some detail of how translatewiki.net works) such {{GENDER}} invocations are extremely common.
* Updated Language::gender() documentation accordingly
2012-02-08 06:09:58 +00:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
mrbluesky
9320b8bed5 Comments only 2012-01-27 22:07:09 +00:00
Alexandre Emsenhuber
f5b75f1e98 Cleanup to statistics:
* Removed 'pcache_miss_invalid' from stats.php and clear_stats.php, no longer used
* Added missing 'job-insert' and 'job-pop' to clear_stats.php
* Added missing call to wfIncrStats( 'pcache_miss_absent' ) when there's no key in ParserCacge::get()
* Removed useless 'pcache_not_possible' stat from OutputPage::addWikiTextTitle() since that function is mostly used for interface messages
2012-01-23 16:27:13 +00:00
Platonides
49e6e233ec Bug 33845: Headings become cursive in TOC when they contain an image
Fixes the problems with r102179 and r102179, as there are
valid tags which begin the same, which meant they were not removed from
the TOC (the second regex, intended to remove tag parameters, then converted
<img or <blockquote> into <i> / <b>).
The same problem existed in the original regex, but as there are no valid 
tags which begin with sup or sub, it never happened).

Added comment explaining the tocline regex, and added a bunch of parser tests.
2012-01-21 16:27:27 +00:00
Aaron Schulz
5a6559d8b1 Reverted r108743 per CR comment. This should at least be discussed first. 2012-01-12 19:41:18 +00:00
Sam Reed
a5c200a25b Kill "* @return void" 2012-01-12 19:12:24 +00:00
Max Semenik
b7e7a6c76e Made Parser::addTrackingCategory() public to benefit tag hooks/parser functions developers 2012-01-11 15:42:29 +00:00
Sam Reed
3f704bbe0b Fix whitespace
Fix/improve documentation
2012-01-10 18:42:59 +00:00
Niklas Laxström
0865348cd4 Missing @since tags have a yet another victim 2012-01-09 19:11:55 +00:00
Sam Reed
7632e4a26f * (bug 33525) clearTagHooks doesn't clear function hooks.
* (bug 33523) Function tag hooks don't appear on Special:Version.

Patches by Nikola Kovacs
2012-01-04 21:30:06 +00:00
Antoine Musso
f6df3e972d revert r107006
(bug 23427) Introduced {{PAGEID}} variable to expose page.page_id
[patch by Waldir]
2012-01-04 09:08:16 +00:00
Brion Vibber
344319f428 Revert r107773 - increases parsercache fragmentation without clear benefit 2012-01-03 21:20:35 +00:00
Alexandre Emsenhuber
9dbf69692c * (bug 32686) Tooltip on links to non-existing pages are now always in user's language
Fixed this by "abusing" of the $options parameter of Linker::link() to pass the Language object (as we did for wfMsgExt()), has the two following advantages:
* The tooltip is displayed in the requested language instead of depending on $wgLang
* The usage of the Language object is detected in the ParserOptions, thus the parser cache key will not have "*" for the language
2012-01-01 14:01:49 +00:00
Brian Wolff
770cd71b51 (bug 31469) Make sure tracking category messages expand variables like
{{NAMESPACE}} relative to the Title of the currently being parsed page.

Basically wfMsgForContent expands messages with wrong title while doing linksupdate stuff via job queue. For the broken file tracking category (r86534),Wikipedia folk want to sort the page into different categories based on namespace, and for some namespaces not categorize them at all (After all, a broken file link in a talk namespace is often not a bad thing).

Anyhow, explicitly set the title object for the message using wfMessage. There's probably deeper issues here in regards to why wfMsg et al is using wrong title, but this should fix the immediate issue.
2011-12-30 06:44:38 +00:00
Danny B
ff2ef8285a * (bug 23427) Introduced {{PAGEID}} variable to expose page.page_id [patch by Waldir] 2011-12-21 23:19:24 +00:00
Brion Vibber
c1906d53de Provisional revert r106573, r106559: may be the wrong thing to do, and should probably come with regression tests if added. 2011-12-20 21:24:06 +00:00
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