Commit graph

554 commits

Author SHA1 Message Date
Bryan Tong Minh
41231616b6 (bug 23002) Imagelinks table not updated after imagemove. The actual bug was inconsistent behaviour between imagelinks and pagelinks for redirects.
* Parser now only adds the redirect source to imagelinks, like it does in pagelinks
* ImagePage now shows the file redirects in-line with the normal "The following pages link to this file:"
** Added message linkstoimage-redirect
** Removed the separate file redirects section and removed associated message redirectstofile
** ImagePage::imageLinks will first fetch image links to the file, determine which are redirects, and if there are fewer links than the limit, fetch the redirect target links.
2011-05-14 12:20:45 +00:00
Sam Reed
f985524076 More versions added to @deprecated tags
Couple of inbound calls fixed up

Some ancient code removed as it's been marked deprecated
2011-05-06 21:50:18 +00:00
Sam Reed
21d35067b9 Kill some more long deprecated unused functions
Add more @deprecated since where appropriate
2011-05-06 21:09:34 +00:00
Leo Koppelkamm
384d4383a3 Fix PHP notice in r85922. Sorry for the holdup, I kinda forgot about it 2011-05-05 09:12:55 +00:00
Sam Reed
e8e63594de Make a method static per the comment, update the only non static usage (in Parser) itself 2011-05-01 23:59:41 +00:00
Sam Reed
018a22d827 Documentation tweaks, additions and updates 2011-05-01 23:54:41 +00:00
Sam Reed
ef6afb5d9e Tweak documentation
Add braces
2011-04-29 23:34:37 +00:00
Sam Reed
409b547cae * (bug 28719) Do not call mLinkHolders __destruct explicitly
Patch by Vitaliy Filippov
2011-04-27 20:05:39 +00:00
Leo Koppelkamm
a4296effc7 Add |alt= option for galleries ( Bug 18682 ). Recommit of r86749, with nested |alt= now fixed. Patch by Jan Paul Posma 2011-04-25 13:51:54 +00:00
Leo Koppelkamm
8548adf48f Reverting r86749: The alt stuff is far too simplistic. One way to fix it would be to generalize makeImage() in the parser to process gallery params as well, but I don't have time to that now 2011-04-23 09:55:42 +00:00
Leo Koppelkamm
f3e6866d1a Add ability to use add alt texts for images in galleries ( Bug 18682 ). Patch by Jan Paul Posma. Also cleaned up some comments and var names 2011-04-23 07:27:45 +00:00
Brion Vibber
2c55eba5c7 Doc comment updates for CoreTagHooks callback functions + Parser::setHook() & Parser::setTransparentTagHook().
Added notes about the 'extended' return values from some of the hooks, which seems to be undocumented but is vaguely similar to what is documented for parser function callbacks. It doesn't look like a very safe interface, and could stomp on internal variables if one isn't careful. Needs to be better defined and doc'd.

setTransparentTagHook() seems to have been largely undocumented and is only used by the 'geoserver' extension currently. Is this considered obsolete? Should it be simply replaced by use of the frame & recursiveTagParse goodies, or is it still needed for something?
2011-04-22 19:06:52 +00:00
Leo Koppelkamm
6e7c9e2701 Fix Bug 25794: Disallow multiple table captions & only keep the first 2011-04-21 07:27:05 +00:00
Chad Horohoe
783d4e0862 Remove @static from all over the place. That's what the static keyword is for, this being PHP5 and all 2011-04-21 00:07:09 +00:00
Brian Wolff
35c61744a6 (bug 23816) Add tracking category for any page with a broken image.
Note this considers a link to a non-existent image to be broken. A link
to an image that exists but does not have a handler is not considered broken.
2011-04-20 19:43:47 +00:00
Sam Reed
3a0ed7a044 * (bug 28532) wfMsgExt() and wfMsgWikiHtml() use $wgOut->parse()
* (bug 16129) Transcluded special pages expose strip markers when they output parsed messages

Also adding some related documentation during my travels around the code
2011-04-18 12:43:53 +00:00
Happy-melon
2c9cfd7cce Refactor the factory/i18n/list/etc static methods from SpecialPage into their own class; there's no reason we need to be parsing them in every single SpecialPage subclass. Leave all the methods as stubs in SpecialPage.php; if we required PHP 5.3 they could be replaced by a a __callStatic() magic method, but that doesn't work on PHP 5.2.
Also make a few changes to the functions available.  SpecialPageFactory::resolveAlias() now takes an optional subpage and returns array(<name>,<subpage>).  Similarly merge getPage() and getPageByAlias().  There were many examples of (extensions particularly) making dubious assumptions about the presence or absence of subpages or canonical-ness.

I didn't deprecate SpecialPage::getTitleFor() as it's got over six hundred calls.  I'm rather undecided on the best position of getPage()/executePath().  Although the latter needs cleanup anyway.
2011-04-17 11:31:11 +00:00
Alexandre Emsenhuber
4207ab0c63 * (bug 28511) Use [] syntax instead of {} for string offset access 2011-04-17 07:59:58 +00:00
Leo Koppelkamm
cca68b8800 r85922: Fixing another table bordercase 2011-04-15 22:36:09 +00:00
Leo Koppelkamm
b4ec34def9 Followup to r86064 (List with double line-breaks inside tables). Also contains patch for Bug 16700 by Mormegil (Additional linebreak though nested templates). Parsertests for both 2011-04-14 19:28:45 +00:00
Leo Koppelkamm
a163fa3c55 Fix for r85990, which broke lists inside tables; adding test for it 2011-04-14 18:45:04 +00:00
Leo Koppelkamm
3dde00f863 Fixing line-break issues with r85922 2011-04-14 10:02:51 +00:00
Platonides
0677784244 Move </td> and </th> to its own line (unless it's an empty cell)
Fixes the other r86004 test case and r86010 one.
2011-04-13 23:50:33 +00:00
Platonides
887f4eff82 Follow up r85922 moving the </caption> to another line, fixing one of the tests added in r86004. 2011-04-13 23:19:27 +00:00
Platonides
6c0cf20425 Readd support for headings inside tables, broken in r85922 and reported on its CodeReview.
Added testcase for it.
It changes again Parser24.
2011-04-13 22:20:14 +00:00
Leo Koppelkamm
b186286631 Tables: Fix Bug 20078, add test for it 2011-04-13 20:01:23 +00:00
Leo Koppelkamm
86cad27b2b Followup to r85922: Adapt to MW-coding style 2011-04-13 19:46:09 +00:00
Leo Koppelkamm
1c0a4d3611 Followup to r85922: Output th instead of td for tfoot 2011-04-13 12:44:33 +00:00
Leo Koppelkamm
f9b4b296ce Followup to r85922: Fix STRICT error, rmv redundant whitespace 2011-04-13 11:24:38 +00:00
Leo Koppelkamm
109f7bcb9d 2011-04-12 21:27:24 +00:00
Brion Vibber
ff0524b3bc Initial stab at breaking math/texvc out to Math extension.
* (bug 14202) $wgUseTeX has been superseded by the Math extension. To re-enable
  math conversion after upgrading, obtain the Math extension from SVN or from
  http://www.mediawiki.org/wiki/Extension:Math and add to LocalSettings.php:
  require_once "$IP/extensions/Math/Math.php";

This is an initial stab, and a few things remain to be cleaned up:
* messages need to be moved from core to extension
* MW_MATH_* constants should be moved to the extension from core
* old back-compat math names interfaces using those constants should be removed from message files
* classic edit toolbar's math button should be added from the extension (or else dropped) -- currently there's not a clean hook, but could do it by JS
* couple of things like the 'armourMath' function on Language & LanguageConverter may want to be redone just as an unconditional, if that's simpler.

Setting $wgUseTeX alone will no longer have any affect. The var's still there for the moment as a few bits still need to be fully moved out from core.
2011-04-09 00:39:40 +00:00
Sam Reed
decb7d223b Cleaning up my w/c again. Add documentation 2011-04-08 23:53:59 +00:00
Aaron Schulz
3a49b629e6 Follow-up changes to r84610:
* Cleaned up mImageTimeKeys format
* ImageMap: Removed redundant addImage call (makeImage handes this)
* ParserFunctions: added time/sha1 to addImage() call
* Removed excess ampersands in hooks
* Added some function doc comments
2011-04-04 01:22:08 +00:00
Daniel Friesen
e844afb09c Followup r85244; Define all methods as static, implement a DummyLinker to forward calls for passing to hooks and finish off anything in the way. 2011-04-03 12:04:04 +00:00
Daniel Friesen
c817a24081 Drop connetion between Skin and Linker and turn Linker into a staticly usable class. 2011-04-03 11:44:11 +00:00
Jack Phoenix
7afd378a4d mark some public functions as such 2011-04-02 14:48:22 +00:00
Aaron Schulz
0a5016f4e0 Follow-up r84659: no need to pass parser by reference to event handlers 2011-03-24 08:44:42 +00:00
Aaron Schulz
67955599f8 * Replaced crufty BeforeParserMakeImageLinkObj/BeforeGalleryFindFile hooks with BeforeParserFetchFileAndTile hook
* Updated the only calling extension (these was basically single-purpose hooks)
2011-03-24 01:44:48 +00:00
Aaron Schulz
045859614b Straighten out dependency handling from r84610 (files) and before (templates) 2011-03-23 18:23:55 +00:00
Aaron Schulz
a2e9b8be7e * Put parser output file version tracking to core
* Added some ParserOutput accessors
* A few cleanups to fetchFile()
2011-03-23 17:35:40 +00:00
Aaron Schulz
d5460bce86 * Made BeforeParserMakeImageLinkObj/BeforeGalleryFindFile let hooks set sha1 parameter
* Made FlaggedRevs specify files by sha1,timestamp to handle renames with no redirects. This makes them handled as well as templates in this regard. (bug 27836) 
* Moved BeforeGalleryFindFile hook to proper place (don't trigger for non-NS_FILE titles)
* Removed unused mRevisionId field from ImageGallery
* Removed old hotfix from makeMediaLinkObj(); all the current callers would crash beforehand if the title was null anyway
* Updated hook docs (some prior params were missing)
* Broke some long lines and cleaned up some whitespace
* TODO: track file info in core rather than fr_fileSHA1Keys and ugly, duplicated, queries. This should be easy to do now.
2011-03-23 03:13:37 +00:00
Sam Reed
60578c163d Reinstate some lines added during r84357
I guess they're used on some code paths... As it's not an unconditional return...
2011-03-21 15:18:11 +00:00
Sam Reed
4569f31e09 * (Bug 14005) editing section 0 of an existing but empty page gives no such section error
Tested, with minor tweak. Also removed now un-needed code

Patch by Harry Burt
2011-03-19 23:23:32 +00:00
Alexandre Emsenhuber
479efc31eb Fix fatal from r83823 2011-03-19 13:00:11 +00:00
Alexandre Emsenhuber
b974497da8 Changed LinkHolderArray::makeHolder() to use Linker::link() instead of Linker::makeBrokenLinkObj() and Linker::makeColouredLinkObj() 2011-03-15 16:47:55 +00:00
Happy-melon
9ccbe5f7e4 Accept empty square bracket pairs in external links: http://www.example.com?foo[]=bar and [http://www.example.com?foo[]=bar link]. Used for MultiSelect arrays, which feature quite heavily in bugzilla search urls, etc. 2011-03-15 15:09:49 +00:00
Alexandre Emsenhuber
876115459b Make Parser::makeKnownLinkHolder() call Linker::linkKnown() instead of deprecated Linker::makeKnownLinkObj() 2011-03-13 14:00:38 +00:00
Alexandre Emsenhuber
9e0c678ddf Only call ParserOptions::getNumberHeadings() when needed for the benefit of cache sharing when this is not used.
Also fixed a bug in ParserOutput when no option is used; otherwise getUsedOptions() will return false and throw warnings in ParserOptions::optionsHash().
2011-03-06 21:16:22 +00:00
Sam Reed
e1f5c11aee More bits of documentation 2011-02-27 15:23:41 +00:00
Mark A. Hershberger
25f5ca8254 * EOL w/s cleanup
* Normalize function names to eliminate two references to “HalfParsedDATA”
2011-02-24 20:23:49 +00:00
Sam Reed
ccffe43a91 Add a couple of type hints noticed when poking bug 27673 2011-02-24 11:59:51 +00:00
Tim Starling
be3710c312 Fixes for r82645:
* Fixed several obvious bugs in the $wgCiteCacheReferences helper functions, missed due to inadequate testing.
* Don't save complete Title objects to memcached, they contain cached data with a short lifetime.
* Fixed a doc comment.
2011-02-23 23:42:04 +00:00
Mark A. Hershberger
fcf56ed2f3 (Bug #27634) TOC title appears in wrong language
Patch from P.Copp
2011-02-23 20:32:57 +00:00
Tim Starling
a20350dd31 * Rewrote StripState to not use ReplacementArray. The memory usage of FSS was excessive when there were many (>10k) strip items. I used preg_replace_callback(), which is slower than strtr() in the simplest case, but much faster than it when the markers have different lengths, which they usually do.
* It was not necessary to preserve the $stripState->general->setPair() interface since it wasn't used by any extensions.
* Moved StripState to its own file.
* Refactored serialiseHalfParsedText() and unserialiseHalfParsedText() so that the bulk of the functionality is in the relevant modules, instead of using scary direct access to object member variables. Made it support the new StripState. It seemed like a lot of work to go to to support an "emergency optimisation" feature in Cite. Cite updates will be in a subsequent commit.
* Fixed spelling of serialiseHalfParsedText() and unserialiseHalfParsedText(), there is unavoidable interface breakage anyway, due to cache object versioning. 
* Moved transparent tags to their own function, as requested in a fixme comment.
* Added documentation for markerSkipCallback().
* Removed OnlyIncludeReplacer, unused since MW 1.12.
2011-02-23 06:58:15 +00:00
Platonides
78e4547bea Rename startExternalParse() when used for internal usage, per r80818 CR. 2011-02-22 15:05:08 +00:00
Mark A. Hershberger
690ebe937a (Bug #27467) preload can leave UNIQ
Patch to fix from P.Copp
2011-02-19 19:18:02 +00:00
Sam Reed
7d98280f3e More function and variable documentation 2011-02-19 01:02:56 +00:00
Platonides
aeb547b465 Adding more wfProfileOut() 2011-02-10 16:11:34 +00:00
Alexandre Emsenhuber
195eafd6ef * Add a amtitle param to meta=allmessages
Only used used when amenableparser is passed; the user can now define the page used for {{PAGENAME}} and related stuff instead of being hardcoded to "API"
2011-02-09 15:19:45 +00:00
Platonides
a601b4f677 Revert r81738. Extensions calling clearState() with no mOptions fixed. 2011-02-08 16:32:30 +00:00
Brion Vibber
7d158675b2 Tweak for r79018: fatal errors due to something calling parser clearState when mOptions wasn't defined 2011-02-08 13:31:30 +00:00
Daniel Friesen
d06c054971 Switch <editsection> to <mw:editsection> and start hiding these editsection tags from Tidy so it doesn't break them. 2011-02-06 01:38:33 +00:00
Daniel Friesen
1455b81f0c Kill off Linker::getExternalLinkAttributes. 2011-02-05 23:06:36 +00:00
Brian Wolff
13bb571b11 (follow up r79706 to address CR comments) Simplify some of the logic in LinksUpdate.php
Make it so that by default, the parser consdiers categories to have a sortkey of "" unless
specified otherwise. Before, the parser said the sortkey was the page name, and then in LinksUpdate
we reset the sortkey (prefix) to "" if it was the same as the page name.

This way, the parser uniformly outputs the sortkey prefix, instead of a mix between prefix or pagename.

It should be noted, this changes the output of api.php?action=parse for categories that do not have
a sortkey.
2011-02-05 02:16:13 +00:00
Brion Vibber
0f3c246fe5 Provisionally reverting r80430 (bug 529, 12974)
As noted in CR there are some issues where we're trading one set of weird behavior for a different, but previously unknown, set of weird behavior which breaks existing markup that works around the old behavior.
I'd recommend keeping this in store for after the 1.17 stuff calms down so unexpected parser changes aren't cropping up in the middle of things for people working with trunk.

If these are the right changes to make then great -- but they should be done after the consequences are better understood and folks can prepare for changes.
2011-01-26 01:16:18 +00:00
Platonides
90694b1ffd Transforming a message uses automatically $wgTitle, which may not be set if running from eg. a script, usecase broken by r80819.
Creating a new title in transformMsg() in such case. Reverting r80987 (its revert), and r80898 (workaround).

Confirmed that now both the installer and extensions/Translate/scripts/sync-group.php work.
2011-01-26 00:23:39 +00:00
Antoine Musso
8ed6718db0 revert r80819 for now so we can use phpunit
function foo (Title $title = null ) {} does not work
2011-01-25 20:37:33 +00:00
Platonides
b6875ddacc Accept being passed a null Title to startExternalParse(), at the callers responsibility.
Added a note about getUserSig() side-effects.
2011-01-23 18:45:21 +00:00
Platonides
a39b8f1311 Add types to prototypes. 2011-01-23 16:11:14 +00:00
Platonides
1f19b8832c Replace the repeated prologues to set mOptions, clearState(), setOutputType(), setTitle() with startExternalParse() calls 2011-01-23 16:07:13 +00:00
Platonides
10505ce8ee Remove a couple of calls to ParserOptions::resetUsage(), missed on its removal in r79018 2011-01-23 15:56:30 +00:00
Ilmari Karonen
7e5472dea3 followup r80511: make {{PAGENAMEE}} and friends also call wfEscapeWikiText() (why is the code duplicated, anyway??) 2011-01-18 20:15:50 +00:00
Happy-melon
2d8ee839cb (bug 529, bug 12974) alter behaviour of the table- and template-parser:
* Remove the hack from bug 529 which inserts a newline when the template text begins with any block character; this breaks many things in many exciting ways.  I've left it in for now when the text begins with a wikitable, as that markup can't be mistaken for anything else.
* Instead, move the contents of a table cell onto a new line for parsing, so that linestart elements (including nested tables) will parse as normal.  

This means that structures like

{| 
| {{template-containing-wikilist}}
|}

Will still work, but for the right reason, and structures like

{|
| style="color:{{template-containing-hexcode}}" | Foo
| * Bar
| {|
   | Look at me, I'm nested!
  |}
|}

Will all now start to work.  Structures like 

* Foo {{template-containing-wikilist}}

Will now not, but honestly, should they?
2011-01-16 23:57:13 +00:00
Robert Leverington
2a30aa1d25 Add new hook ArticlePrepareTextForEdit, called when preparing text to be saved.
Add new parser option "PreSaveTransform" that allows the pre-save transformation to be selectively disabled.
2011-01-16 21:12:26 +00:00
Platonides
7970796f1a Pasting lines typo in r80025 2011-01-16 16:41:15 +00:00
Daniel Friesen
39ab3cfc9f Implement Message::isBlank and Message::isDisabled.
And while we're at it... update a random assortment of code using wfEmptyMsg to use the new wfMessage class and our exists/isBlank/isDisabled methods.
2011-01-14 10:51:05 +00:00
Platonides
5ceb97cfc3 Follow up r80025.
The space is actually used inside extensions, such as Maps, covertly called as 'display_map' into 
Validator, then converted into 'display map' by getName().
2011-01-12 00:11:11 +00:00
Platonides
f1bcac7be1 Forbid '<', '>', ' ', '\n', '\r' in parser hook names.
Registering a tag hook with < or > on its name resulted in a UNIQ marker.
Spaces, tabs or LF do work (CR fails due to the CR->LF transformation), 
but it's easier to also forbid them, just as they are not allowed in other 
markup languages.
2011-01-11 18:38:32 +00:00
Tim Starling
8e42c60b60 Update comment for r64876 2011-01-07 01:38:06 +00:00
Alexandre Emsenhuber
86d7eeb4d3 Easier method (and to check existence in correct language) 2011-01-05 15:50:34 +00:00
Daniel Friesen
7e0a31a4d4 Allow filenames to be specified in a <gallery> with the File:, Image: or media: omitted by defaulting to NS_FILE. 2011-01-05 06:16:13 +00:00
Platonides
8de91ab2e4 Partial revert of r79520, follow up to r79558. Unconditionally use the new format.
For environments post r70783, they will need to rerender pages with __NOEDITSECTION__ or no headings (hopefully those will be simple pages).
There will be no extra parser cache misses for environments pre r70783.
2011-01-04 11:31:06 +00:00
Daniel Friesen
d3b9fcdc4a Followup r79520 and r79528, one of the args was missing when calling doEditSectionLink. Additionally the LanguageConverter was screwing up editsection markers really badly. Switched to <editsection> pesudo-xml style markers for best compatibility with the language converter. (tags are already escaped so we don't need to worry about similar user input) 2011-01-04 04:20:09 +00:00
Daniel Friesen
ecd545b1fd Followup r79520, some characters inside the encoded data were being modified by the parser causing it to break. Switching to a encoding scheme without that issue and adding a test to throw a less fatal error. 2011-01-03 21:04:05 +00:00
Daniel Friesen
969561ae3c Try to output editsection markers instead of rendered editsection links and defer the rendering to a point where the markup does not need to be stored in the cache.
Doing this allows skins to override doEditSectionLinks without poluting the parser cache or fragmenting the parser cache more.
As a side effect it eliminates the primary cause of user language based parser cache fragmentation.
Because this makes most old parser cache entries invalid $wgUseEditSectionTokens is provided so that large installations like Wikipedia can keep their old parser cache entries.
2011-01-03 20:17:20 +00:00
Platonides
691b4618e2 Document parser, add test cases for the external entry points to it. 2010-12-26 19:30:10 +00:00
Platonides
fe14fdefa7 Store the options used by the parsing in ParserOutput, per r70783 CR. 2010-12-26 19:21:45 +00:00
Brian Wolff
ff5394caed (Bug 26410) In an internal link, a plus sign is treated as a space if the link
has a % sign in it, but interperted as a + if no % sign is present.

This changes how the parser interperts links slightly. However:
*I can't imagine anyone is relying on this behaviour
*Things should be consistent. a + sign shouldn't magically change meaning
if there is a % sign somewhere else in the link.
*Pages are allowed to contain % signs in their title, and + signs,
you should be able to link to such pages just by typing there name without
resorting to %2B.
*If you have a page named foo%+ having [[{{PAGENAME}}]] link to a different
page seems inherently wrong.
*The previous behaviour seemed accidental.
2010-12-24 09:53:08 +00:00
Mark A. Hershberger
aa08646a71 Misc whitespace changes, mostly EOL w/s and indention fixes so TAB = 4 spaces 2010-12-19 04:31:15 +00:00
Tim Starling
36d43eabc0 Fixed comments and indenting style from r68491. 2010-12-14 09:01:48 +00:00
Mark A. Hershberger
e002df9eca * Add FIXME about the bug I found during testing
* Make the only instance of the ParserOptions::getMaxIncludeSize() that doesn't match its method signature match.
2010-12-11 03:53:22 +00:00
Mark A. Hershberger
2e18112d60 Whitespace changes (before others) — “svn diff -x-w” shows no changes 2010-12-11 03:52:35 +00:00
Alexandre Emsenhuber
6d60b96223 Moved constant values from constructor to class definition 2010-12-10 18:48:11 +00:00
Alexandre Emsenhuber
58d09d4d53 Fixes for r78201:
* Per Reedy, add braces where needed
* Revert one change that should not have been there
2010-12-10 18:23:33 +00:00
Alexandre Emsenhuber
510309e4ab * (bug 19006) {{REVISIONUSER}} no longer acts like {{CURRENTUSER}} in some cases
* Removed other usages of $wgUser in Parser stuff, as stated in doc
* Added mechanism to get an User object in Parser, based either on the object given in Paser::preSaveTransform() or the ParserOptions otherwise
2010-12-10 18:17:20 +00:00
Chad Horohoe
699e53dc2f Revert r68230, r68231 (mode="grid" on tables) per CR. It's in the history if anyone wants to work on this again 2010-12-10 16:03:57 +00:00
Sam Reed
c14037a2e0 Fix 1 deprecated method call in SpecialPage, and 3 non static methods called statically 2010-11-28 16:04:48 +00:00
Sam Reed
c15c1c6abb More reversion of r77297, 2 of 2 commits to keep it readable in CR (hopefully) 2010-11-25 22:24:28 +00:00
Antoine Musso
6fe29c9c30 revert r76464
* mixed style changes and variable removing
* logic changes
* useful comments removed
2010-11-25 20:01:34 +00:00
Sam Reed
a54a1ee178 Fixup some more documentation 2010-11-13 00:47:51 +00:00
Sam Reed
10ecfeb03b Various unused variables, add some braces
Explicitally define some variables used in hook type calls
2010-11-10 19:49:04 +00:00
Sam Reed
1e4934e9b7 foreach loop is pointless if you're then just going to keep a counter manually
Hence switch foreach to for loop
2010-11-10 19:19:46 +00:00
Alexandre Emsenhuber
1a4957e0b4 * (bug 21364) External links using link= attribute on images now respect $wgExternalLinkTarget 2010-11-09 12:25:57 +00:00
Sam Reed
d08f91f596 Per CR on r45418...
Explicitally define $refers = array();, as it being in a loop is just slight confusing with the isset
2010-10-18 23:50:33 +00:00
Sam Reed
44cf22acfc Followup r69904, make call to getRandomString static in Parser->unserialiseHalfParsedText() 2010-10-17 18:51:00 +00:00
Alexandre Emsenhuber
f5f01d7d23 Per Platonides, follow-up to r67834: fix doc and removed no more needed return-by-ref of Parser::getTitle() 2010-10-16 18:58:29 +00:00
Platonides
405bc4d998 Follow r69904. Make Parser::getRandomString real private.
Parser_DiffTest::dtUniqPrefix is now lazyloader.
I also fixed the typo in its declaration.
2010-10-15 22:12:19 +00:00
Sam Reed
6b3b915353 Big attack on unused variables... 2010-10-14 20:53:04 +00:00
Platonides
7b6afb1996 Change the FIXME to the other way.
The issue is, php strtolower() calls tolower(3), which is locale sensitive.
Eg. LC_ALL='pt_BR.ISO-8859-1' php -r'echo strtolower("ÉÁÇÚÍ");'

Adding a call to setlocale(LC_ALL,'C'); in Setup.php may be a good idea.
2010-10-08 22:51:03 +00:00
Platonides
3d408e8d5b Remove $wgServerName. Its only usage was for {{servername}}, and needed to be kept in sync with $wgServer in LocalSettings.
None of the 3 globals based on it changed if you set it in LocalSettings.

Note that all those !isset( $wgServerName ) in ApiTests were useless, since if not in LocalSettings it would be 'localhost', not null (as still are those !isset( $wgServer )).
2010-09-29 15:47:56 +00:00
Sam Reed
22764a53f8 Braces, spaces, and a few unused arrays 2010-09-21 06:55:49 +00:00
Platonides
537826a674 Remove $wgContLanguageCode usage in core.
sed -i 's/$wgContLanguageCode/$wgLanguageCode/g'
These are now the same, always. Per and since r15827.

$wgLanguageCode wins due to being the one set by LocalSettings.

$wgContLanguageCode definition at includes/Setup.php kept for now.
2010-09-07 22:37:55 +00:00
Conrad Irwin
efb47b97d2 Bug 6204 - TOC not properly rendered when using $wgMaxTocLevel
Credit for mini-patch to Brandon Ooi
2010-09-04 00:03:45 +00:00
Sam Reed
18346aa7e2 Remove unused global
Simplify some logic
2010-09-02 23:12:47 +00:00
Philip Tzou
0f6c992519 follow up r69134. Change all of convertLinkToAllVariants()'s callers to call autoConvertToAllVariants(). 2010-08-23 02:07:31 +00:00
Sam Reed
721ecb6d2d Remove some more unused variables
Remove srvus() from Parser, unused, and calling testSrvus wrongly
2010-08-19 11:21:14 +00:00
Platonides
9e96f8db77 Parser should only use content messages. 2010-08-12 13:23:28 +00:00
Platonides
69ad72018b Followup r70783. Give doEditSectionLink an extra parameter with the language to use for the editsection. 2010-08-12 12:30:47 +00:00
Platonides
a72332929c getSkin() should get a Title as parameter. 2010-08-11 17:11:24 +00:00
Platonides
34d35fb6f9 Use only the page relevant pieces in the parser cache key. Eg. two users with different math options will now
use the same parsercache entry for articles without <math> tags.
The cache key format is kept as a fallback so the old cached entries can be reused.

Should boost parsercache hits, but it also makes easier to pollute the parsercache by tag hooks that behave 
badly, directly using $wgUser or $wgLang.

Extensions hooking PageRenderingHash now see !edit=0 and the !printable=1 bits.

Fixes bug 24714 - Usage of {{#dateformat: }} in wikis without $wgUseDynamicDates can lead to unexpected results

Builds upon r70498, r70498, r70501, r70517, r70651, r70653, r70765, r70780.
2010-08-09 21:53:21 +00:00
Platonides
6d20e79faf Make thumbsize option go through ParserOptions.
Yet another parameter for makeImageLink2...
2010-08-07 22:35:23 +00:00
Aryeh Gregor
65e8acdf0a Improve $wgExperimentalHtmlIds support
Now works (again?) in IE6.  That didn't like getting non-legacy ID's on
redirects -- it doesn't interpret them as UTF-8, so anything non-ASCII
breaks.  If this works in all the browsers I test in, I'll enable it --
it will produce *much* nicer-looking anchors for non-English wikis, and
also section names with English punctuation.
2010-08-05 20:16:43 +00:00
Platonides
9c143c5900 Use ParserOptions accessors.
Only one direct usage remains, in ParserCache::getKey, which will be rewritten.
2010-08-05 19:01:47 +00:00
Sam Reed
5582aca1ed * (bug 23848) Add {{ARTICLEPATH}} Magic Word
Apply my patch, as it seems to be working when I tried it this time
2010-08-05 15:21:15 +00:00
Platonides
5dd9a37af3 Follow up r70498. Actually remove the quickUserCan(). 2010-08-05 14:46:14 +00:00
Platonides
7bfebad308 Change quickUserCan( 'edit' ) and getIsPrintable() into setEditSection( false )
Follow up r48544. Init ParserOptions::mIsPrintable in initialiseFromUser()
Move the "No edit section it's printable" from Parser to Article.
This leaves getIsPrintable() unused. Left there for extensions (none seems to be using it, could be removed).

The "even if the user has them on" comment wasn't accurate. The user preference only controls them via CSS.
Anyway, it would work as expected now if it got moved into ParserOptions. The setEditSection() no longer set it to true.

Remove the quickUserCan( 'edit' ) which is just a hidden way of calling $wgUser from the Parser to be explicitely 
done in Article to disable the editsection. This results in quickUserCan being called once instead of twice if $wgUseETag == true;.
2010-08-05 14:37:50 +00:00
Platonides
b572c9c147 Followup r69961. Remove now unused global. 2010-07-27 12:19:08 +00:00
Platonides
c7e85a5e04 Insert a new line in between when adding </td><td> in tables.
This is html neutral, but helps the parser to realise that things should be broken there.
Fixes the tag nesting issues of the [ftp://|x||]] parser test.
Parser16 test still has its own tag bug.
2010-07-26 22:29:20 +00:00
Aryeh Gregor
022b7ba140 Reconcept cl_raw_sortkey as cl_sortkey_prefix
In response to feedback by Phillipe Verdy on bug 164.  Now if a bunch of
pages have [[Category:Foo| ]], they'll sort amongst themselves according
to page name, instead of in basically random order as it is currently.
This also makes storage more elegant and intuitive: instead of giving
NULL a magic meaning when there's no custom sortkey specified, we just
store an empty string, since there's no prefix.

This means {{defaultsort:}} really now means {{defaultsortprefix:}},
which is slightly confusing, and a lot of code is now slightly
misleading or poorly named.  But it should all work fine.

Also, while I was at it, I made updateCollation.php work as a transition
script, so you can apply the SQL patch and then run updateCollation.php
and things will work.  However, with the new schema it's not trivial to
reverse this -- you'd have to recover the raw sort keys with some PHP.
Conversion goes at about a thousand rows a second for me, and seems to
be CPU-bound.  Could probably be optimized.

I also adjusted the transition script so it will fix rows with collation
versions *greater* than the current one, as well as less.  Thus if some
site wants to use their own collation, they can call it 137 or
something, and if they later want to switch back to MediaWiki stock
collation 7, it will work.

Also fixed a silly bug in updateCollation.php where it would say "1000
done" if it did nothing, and changed $res->numRows() >= self::BATCH_SIZE
to == so people don't wonder how it could be bigger (since it can't, I
hope).
2010-07-26 19:27:13 +00:00
Sam Reed
1a96bd4aa2 Followup r69904 $self to self 2010-07-25 20:51:16 +00:00
Sam Reed
a02f418196 Make getRandomString static as per comment
Fix usage in top of Parser (changed by me earlier)
2010-07-25 20:44:40 +00:00
Sam Reed
8b8500c121 More self:: to $this-> 2010-07-25 18:13:56 +00:00
Sam Reed
04f68827d0 Removal of unused globals
Removal of one setting of a variable to '', then not using further
2010-07-24 19:11:52 +00:00
Roan Kattouw
be40cca131 Kill two functions in Parser that have been ununused forever, add a clarifying comment elsewhere. 2010-07-20 09:23:37 +00:00
Platonides
a5655cfdf2 Update the old magic with new one.
Not only should this have used setContainsOldMagic() instead of manually modifying the member, 
the outdated magic reduced the caching time to one hour even if you just used something like 
{{currentmonth}}, which is hinted to one day.

This is the only usage of old magic, we could remove it but perhaps it is used by some extension?
2010-07-19 23:08:52 +00:00
Sam Reed
18b308afd6 Followup r69235
Replace setPropert with setProperty
2010-07-10 11:46:47 +00:00
Bryan Tong Minh
a3aac44f04 (bug 14685) Double underscore magic word usage is now tracked in the page_props table, as well as the behavioral magic words {{DEFAULTSORT}} and {{DISPLAYTITLE}}. 2010-07-10 11:30:11 +00:00
Platonides
7b3b076f4d Follow up r68491.
Perform doAllQuotes before external links.
Added test case from http://es.wikipedia.org/w/index.php?title=Pablo_Picasso&action=edit&section=5&oldid=38079844
2010-06-24 13:44:50 +00:00
Platonides
e7d06d4aff Disable pretty italics inside links. Now the italics inside a link alternate text will be handled on its own scope but if they come from the page title, they won't be parsed at all. This is a middle way solution to bug 4598. Now all bug 4598 tests pass.
Pretty italics mean that italics go across links: ''Some [[Link|pretty ''italics'' and stuff]]! -> ''Some [[Link|pretty ''italics'' and stuff]]! -> <i>Some <a>pretty <i>italics</i> and stuff</a>!</i>

This also fixes bug 24093, where interface messages saying '''[[$1]]''' has been deleted/renamed/links here were being bitten by this feature.

The best resolution would be to make pretty italics still work inside alternates, feel free to do so, but doesn't seem worth at this point. The right solution should be to rewrite the quotes handling so it takes its scope into account.
2010-06-23 23:29:54 +00:00
Conrad Irwin
eb41544de5 (bug 22784) Fix normalization of whitespace in autocomment links
put this specific normalisation into Sanitizer::normalizeSectionNameWhitespace
instead of repeating it three times.
2010-06-21 01:17:36 +00:00
Conrad Irwin
e3e24db382 (bug 17857) Make {{anchorencode}} work in a manner more similar to the way that
section links are created by the parser. Also useful for (bug 18431).
2010-06-20 23:43:39 +00:00
Daniel Kinzler
389eba6bd9 follop-up to 68230: forgot to commit the styles needed for layout grids 2010-06-18 19:21:04 +00:00
Daniel Kinzler
4760201ac2 let mode="grid" on a wiki table trigger output as div soup instead of a html table. this should get rid of "layout tables" that confuse screen readers etc. this is very experimental - feel free to revert, i just want to have this diff in the repository, to play with... 2010-06-18 19:17:17 +00:00
Alexandre Emsenhuber
de27b8eee9 * Fixed some doxygen warnings
* Groupped some related functions
2010-06-10 21:05:58 +00:00
Roan Kattouw
f354f69bc2 Fix fatal in r67185 2010-06-01 19:40:35 +00:00
Daniel Kinzler
36c68af119 allow parser/extensions to control for how long a ParserOutput gets cached. Introduced updateCacheExpiry(), Cleaned up use of getCacheTime() for marking uncacheable objects. 2010-06-01 14:28:51 +00:00
Aryeh Gregor
74a21f3bd1 Remove most named character references from output
Recommit of r66254 to trunk.  This was just

find extensions phase3 -iname '*.php' \! -iname '*.i18n.php' \! -iname 'Messages*.php' \! -iname '*_Messages.php' -exec sed -i 's/&nbsp;/\&#160;/g;s/&mdash;/―/g;s/&bull;/•/g;s/&aacute;/á/g;s/&acute;/´/g;s/&agrave;/à/g;s/&alpha;/α/g;s/&auml;/ä/g;s/&ccedil;/ç/g;s/&copy;/©/g;s/&darr;/↓/g;s/&deg;/°/g;s/&eacute;/é/g;s/&ecirc;/ê/g;s/&euml;/ë/g;s/&egrave;/è/g;s/&euro;/€/g;s/&harr;//g;s/&hellip;/…/g;s/&iacute;/í/g;s/&igrave;/ì/g;s/&larr;/←/g;s/&ldquo;/“/g;s/&middot;/·/g;s/&minus;/−/g;s/&ndash;/–/g;s/&oacute;/ó/g;s/&ocirc;/ô/g;s/&oelig;/œ/g;s/&ograve;/ò/g;s/&otilde;/õ/g;s/&ouml;/ö/g;s/&pound;/£/g;s/&prime;/′/g;s/&Prime;/″/g;s/&raquo;/»/g;s/&rarr;/→/g;s/&rdquo;/”/g;s/&Sigma;/Σ/g;s/&times;/×/g;s/&uacute;/ú/g;s/&uarr;/↑/g;s/&uuml;/ü/g;s/&yen;/¥/g' {} +

followed by reading over every single line of the resulting diff and
fixing a whole bunch of false positives.  The reason for this change is
given in <http://lists.wikimedia.org/pipermail/wikitech-l/2010-April/047617.html>.
I cleared it with Tim and Brion on IRC before committing.  It might
cause a few problems, but I tried to be careful; please report any
issues.

I skipped all messages files.  I plan to make a follow-up commit that
alters wfMsgExt() with 'escapenoentities' to sanitize all the entities.
That way, the only messages that will be problems will be ones that
output raw HTML, and we want to get rid of those anyway.

This should get rid of all named entities everywhere except messages.  I
skipped a few things like &nbsp that I noticed in manual inspection,
because they weren't well-formed XML anyway.

Also, to everyone who uses non-breaking spaces when they could use a
normal space, or nothing at all, or CSS padding: I still hate you.  Die.
2010-05-30 17:33:59 +00:00
Platonides
3b150034a0 (bug 8689) Use strict php comparison, so that inserting a long numeric line doesn't produce a fatal error when php tries to convert it to a number. 2010-05-28 14:16:46 +00:00
Chad Horohoe
e1ff6c41dd Typo in comment 2010-05-21 21:08:05 +00:00
Ilmari Karonen
9d0292de51 bug 23588: properly colon-escape links used to replace transclusions if post-expand include size is too large 2010-05-19 00:03:54 +00:00
Jack Phoenix
bcee7c2238 Parser.php: trim trailing spaces 2010-05-15 10:35:54 +00:00
Matěj Grabovský
449b936efd (bug 23426) The {{REVISIONMONTH}} variable is now zero-padded and added new variable {{REVISIONMONTH1}} when unpadded version is needed. 2010-05-11 16:24:14 +00:00
Platonides
73649741ed Recovered parser test whose content got broken in r12975, functionality broken in r14635.
Changed what used to be EXT_LINK_TEXT_CLASS to
define( 'EXT_LINK_TEXT_CLASS', '[^\]\\x00-\\x08\\x0a-\\x1F]' );
In plain English, do not allow control characters in description. We still allow tabs
there, since they may arrive from a paste.

We should probably make the space between the text and the description mandatory, it needs testing.

These tests only work with the Hash Preprocessor, since the DOM Preprocessor changes them into the 
replacement character. Should we autolink an URL with a FFFD? That will require changing some regex 
into unicode ones.
2010-05-05 21:58:39 +00:00
Brion Vibber
e1d1404372 Cleanup for bugs in r65104 (iwlinks table), that'll teach me not to commit at 4am after drinking with the wikimedia devs! 2010-04-18 00:39:12 +00:00
Brion Vibber
8eac509ab5 * (bug 14473) Add iwlinks table to track inline interwiki link usage
Like langlinks, this stores the interwiki prefix (as iwl_prefix) and full page title (as iwl_title), attached to the page doing the liking (as iwl_from -> page_id).
Unlike langlinks, there can be multiple entries stored per interwiki prefix.

Updater to add the table confirmed on MySQL, untested on SQLite but should work.
Someone may still need to add and test a PostgreSQL updater.

Refactored makeWhereFrom2d() out of LinkBatch to Database so it could be re-used for the similar mapping for the interwiki links, which need a string prefix rather than an int namespace key.
Also cleaned it up internally to reuse existing code for building where clauses from arrays. (Tim & Domas -- if the previous more verbose code was there to reduce function call and array processing overhead on very large link lists, feel free to unroll it again if the difference is measurable. Just swap the var names around from the old LinkBatch code and escape the base key value if it's not an integer, it'll be functionally equivalent.)
2010-04-16 01:40:05 +00:00
Happy-melon
2de185e530 Follow-up to r64407 - a perfect example of why we encourage using braces for one-line conditionals in the first place. 2010-04-10 16:44:10 +00:00
Tim Starling
3a2345fe1c Proposed cleanup of recent LanguageConverter-related commits:
* Moved the responsibility for calling $wgOut->setPageTitle() from OutputPage::addParserOutputNoText() to the OutputPage/Parser caller. Previously, every call to $wgOut->addWikiText() (or any other message parsing function) was resulting in the title being reset to a converted version of $wgTitle, producing bug 23124. Moving responsibility to the caller seems to work fairly well, since there are apparently only two callers that really want {{DISPLAYTITLE}} etc. to work (EditPage and Article::view). 
* Reverted data flow obfuscation in OutputPage::setHTMLTitle() from r64851, replaced by the above. The caller decides what overrides what.
* Reverted inappropriate, cache-polluting references to $wgUser and $wgRequest in Parser::parse(), introduced in r64819.
* Reverted incomprehensible boolean parameter to Language::convert() from r64851, reintroduced Language::convertTitle() instead. Gave it a simpler implementation than before.
* Fixed broken {{DISPLAYTITLE}} feature, was being unconditionally overwritten by the ParserOutput::setTitleText() call in Parser::parse(). Give {{DISPLAYTITLE}} precedence over autoconverted title, like we do for -{T|...}-.
* Tested extensively (perhaps not exhaustively)
2010-04-10 13:38:50 +00:00
Philip Tzou
7116f96739 Follow up r64851. Remove $wgOut. 2010-04-10 07:07:49 +00:00
Philip Tzou
221f00408a Fix bug 23115 again. Follow up r64821, r64823 and r64827. Rewrite the converted title to HTML title if the HTML title haven't set by other messages. 2010-04-10 05:46:01 +00:00
Platonides
ec61db2425 Follow up r64828. It was a typo, there's no variable called $wgDisableContentConversion 2010-04-09 20:47:05 +00:00
Philip Tzou
e40921d0b4 Sorry it's $wgDisableLangConversion. 2010-04-09 20:39:56 +00:00
Raimond Spekking
47f2ddfa4e Follow-up r64819: PHP Notice: Undefined variable: wgDisableContentConversion in /www/w/includes/parser/Parser.php on line 379 2010-04-09 20:34:53 +00:00
Platonides
122f0f3c77 Convert the previous title instead of getting it again, so the Main Page keeps pagetitle-view-mainpage as its title. 2010-04-09 20:27:57 +00:00
Platonides
ca78b880a2 Recover namespace names. 2010-04-09 19:46:26 +00:00
Platonides
dc7d0302b1 Follow up r64819. Cosmetical fixes. 2010-04-09 19:35:14 +00:00
Philip Tzou
99240b4946 Bug 23115: Follow up on r64811. Fix another bug which cause talk page can't converted. And fix the title convert problem. 2010-04-09 19:02:04 +00:00
Platonides
551f826d7e Follow up r64813 and r64814 by also applying r64814 to the branches. 2010-04-09 18:08:38 +00:00
Platonides
84b6aa1ce3 Follow-up r64811 on fixing bug 23115.
This restores convert rules to the same ones as before r61101.
2010-04-09 17:56:42 +00:00
Philip Tzou
6175f010ce Bug 23115: Language Converter should apply on talk page. 2010-04-09 17:42:38 +00:00
Jack Phoenix
d561849fca documentation tweak 2010-04-02 20:56:11 +00:00
Happy-melon
bec172cb54 Rationalise comment format. Slightly controversial, perhaps, but I've pretty much borked svn blame already :D Also other doc and spacing fixes. 2010-03-30 21:53:56 +00:00
Happy-melon
af56e348c1 Overhaul code format to coding conventions. 2010-03-30 21:20:05 +00:00
Aryeh Gregor
759db54cc2 Correctly handle <abbr> followed by ISBN
Bug 22905.  Patch based on one submitted by Solitarius.  Basically, we
were assuming that anything matching <a.*?</a> was a link and ignoring
it so as to avoid nested links, but that matched the HTML from

<abbr>(fr)</abbr> ISBN 2753300917 [http://www.example.com example.com]

so the ISBN didn't work.  Parser test committed, fails without the
Parser.php change.
2010-03-24 13:42:37 +00:00
Raimond Spekking
20e131c3a2 * (bug 21981) Add parameter 'showfilename' to <gallery> to automatically apply the names of the individual files within the gallery 2010-03-13 09:43:37 +00:00
Conrad Irwin
a88a955ebf Merge fixes to ?preload= from /branches/conrad/ (cf. bug 5210, r62864, r62035) 2010-03-03 02:41:14 +00:00
Tim Starling
c166e49bca Fixes for r62505:
* In MagicWordArray::matchStartAndRemove(), fixed the case where the length of localised synonym is not precisely the length of the magic word ID plus one
* Fixed the case where matchStartAndRemove() removes the entire string, send empty string not false
* Fix brace style
2010-02-22 07:02:12 +00:00
Domas Mituzas
ac961eca63 global already imported few lines above 2010-02-21 17:07:37 +00:00
Tim Starling
f5b882aadc Moving Conrad's recent parser work out to a branch. Reverted r62434, r62416, r62150, r62111, r62085, r62081, r62080, r62077, r62076, r62069, r62049, r62035. 2010-02-19 05:19:32 +00:00
Mark A. Hershberger
b03bcaacd9 fixes #22501 follow up r61101 remove superfluous, buggy code that was over-rideing displaytitle 2010-02-15 20:18:05 +00:00
Conrad Irwin
8b23dcc084 clean r61713 (and r61710) per code review 2010-02-15 09:34:51 +00:00
Mark A. Hershberger
daf51bcdb3 follow up r61101 for special pages like Special:Version and Special:RecentChanges 2010-02-15 08:36:10 +00:00
Conrad Irwin
26d1b34771 Fix for <poem> after r62416 2010-02-13 14:41:04 +00:00
Conrad Irwin
ae1e32d350 Deprecate old undocumented workaround to bug 2257 (setTransparentTagHook) 2010-02-13 02:22:14 +00:00
Conrad Irwin
76d285dc36 More sensible semantics for pipe trick with section links after r62076
[[hello#world|]] -> [[hello#world|world]] (not [[hello#world]])
2010-02-09 01:05:49 +00:00
Conrad Irwin
7a1fc37382 partial revert for r62081. Make {{PIPETRICK}} like {{PAGENAME}}, add {{PIPETRICKE}}. fix r62077 better. 2010-02-08 02:07:15 +00:00
Conrad Irwin
fe91f53371 Fix bug 20339 allow pipe-trick in log reasons
follows on from r62069 moving logic from Parser into Linker 
(copying brion's technique for dealing with subpages)
2010-02-07 14:50:55 +00:00
Conrad Irwin
14ebd07539 Initialize parser properly in getTransclusionText() 2010-02-07 11:59:58 +00:00
Conrad Irwin
8e258183ae Update Pipe Trick semantics per bug 845 and bug 21660
Allows fullwidth variants of "(", ")", and "," everywhere
Adds [[#section|]] -> [[#section|section]] (initial # only)
Adds [[/sub/section|]] -> [[/sub/section|section]]
2010-02-07 02:15:26 +00:00
Conrad Irwin
13cc94a6c0 Allow pipe trick to work after PST.
Fixes bug 4099, bug 8785, partially bug 16714, bug 2700.
2010-02-06 15:00:45 +00:00
Conrad Irwin
ee6dd72b7f style fixes for r62035 2010-02-05 21:52:37 +00:00
Conrad Irwin
f367303c9e bug 5210 - add getTransclusionText() to the Parser to remove the horrible (and
very broken) attempt to reimplement bits of the preprocessor in 
           EditPage.php.
2010-02-05 16:49:21 +00:00
Tim Starling
c7a8875329 * Fix for r57997 and bug 21222: move math, gallery, pre and nowiki to a new module called CoreTagHooks, analogous to CoreParserFunctions.
* Extended the return interface for tag hooks in a way analogous to the one for parser functions, allowing <nowiki> and <html> to specify that they want to be in the nowiki replacement array instead of the general replacement array.
* Removed ParserOptions::setUseTeX() and related. If <math> is going to be registered in firstCallInit(), then it needs to be stable across multiple parser calls and not change based on parser options. Only one extension caller.

In parserTests.inc: 
* Fixed parser test failures due to $wgMathDirectory not being properly set up. The math directory of the host wiki was being used, leading to a parser test failure if it was not writable.
* Fixed message cache hack from r15502. Made parser tests not fail in the case where a tested message is overwritten by the local wiki. All tests now pass on my installation.
2010-02-03 07:10:58 +00:00
Tim Starling
5ff4947c48 Remove <a> tag hook for now, pending resolution of implementation issues as discussed on CR r58717. 2010-02-03 05:07:57 +00:00
Mark A. Hershberger
93562ac595 fixes problem on PHP 5.1 where titles are displayed as "Object":
TimStarling sez: "presumably some clever person has been using __toString()"
Why did it have to be in code *I* wrote?
2010-02-01 02:45:23 +00:00
Aryeh Gregor
a889c89d1b Require $wgHtml5 for $wgExperimentalHtmlIds
This way, if you want to disable HTML5 you don't have to turn off an
extra setting to maintain validity.
2010-02-01 01:43:07 +00:00
Max Semenik
d6e5fcf83d (bug 16039) Text disappearing after a bad image 2010-01-31 18:26:37 +00:00
Conrad Irwin
7dee03cbdf Fix for r61710. Changing subst: to subst:$1 would cause huge problems with localisation
instead add some proper functions to MagicWord.php to deal with the situation.
2010-01-30 12:46:16 +00:00
Conrad Irwin
13eb1fe98e bug 22297 - "syntax for substitution that doesn't break transclusion"
Adds "safesubst:$1" that works similarly to "subst:$1"
(relevant to bug 5453, bug 16714, bug 4484)
2010-01-30 11:58:19 +00:00
Aryeh Gregor
f8879bfd2b Refactor $wgEnforceHtmlIds code
Renamed setting to $wgExperimentalHtmlIds, off by default, and updated
the code to enforce the much laxer HTML5 rules.  Still needs testing in
various browsers.
2010-01-29 21:44:01 +00:00
Tim Starling
8b9bedbad7 Revert r61528, r61527, r61526, r61525, r61519, r61515, r61053, r61052 (Parser::doQuotes() rewrite). Lots of issues to discuss, needs more review than I have time to give it pre-1.16. I'll split it out to a branch. 2010-01-27 02:41:22 +00:00