Commit graph

12 commits

Author SHA1 Message Date
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Brion Vibber
5cbe54fa7b * (bug 13522) Fix fatal error in Parser::extractTagsAndParams
Patch by MinuteElectron - https://bugzilla.wikimedia.org/attachment.cgi?id=4772 with fixes
Replaces an instance variable with a constant, since it doesn't change, which is safe to access when the function is called statically from an outside class, as some extensions do.
2008-03-27 00:00:25 +00:00
Tim Starling
2c76c39737 Stack depth limit for expand() 2008-03-25 04:26:58 +00:00
Tim Starling
133b549c8d Fix bug 13253: <NOINCLUDE>foo</NOINCLUDE> causes exception 2008-03-05 01:07:47 +00:00
Tim Starling
db33512d7e Documentation. 2008-02-18 07:45:44 +00:00
Tim Starling
6fb641cdfd * Added alternate preprocessor implementation "Preprocessor_Hash" which uses plain PHP hashtables for the underlying data structure. This removes the DOM dependence, avoids XML charset problems, and avoids the lack of memory accounting in DOM. It will hopefully serve as a better model for alternate language implementations than the DOM version. I haven't measured the preformance yet, but it should be comparable to Preprocessor_DOM. If the performance is good, this might be a better default than Preprocessor_DOM.
* Verified Preprocessor_Hash against Preprocessor_DOM with a differential fuzz test.
* Improved the utility of Parser_DiffTest by synchronising strip markers and allowing for loose object comparison. 
* Abstracted PPDStack to make it usable in Preprocessor_Hash.
2008-02-05 08:23:58 +00:00
Tim Starling
eb76c1f16c Fix a regression of bug 4899 due to HHPv2: <h> tags now appear on tree depth levels other than the first. The 4899 aspect is easily fixed by having extractSections() look at the i attribute instead of just counting.
The implications in general are that headings inside properly-closed double braces will not have section edit links, even where the braces are broken by invalid title characters and expanded literally to recover the heading. Respecting such headings as section breaks would run into the same problems as those discussed w.r.t. LST on wikitech-l -- there's no way to recover the text for a section that starts on one tree level and finishes on a different one. The fact that higher level <h> nodes appear in the XML is just due to a shortcut in preprocessToObj(): headings are put into the stack in case the braces turn out to be unclosed, in which case the heading will be at level 1 of the tree.
2008-02-01 01:35:55 +00:00
Tim Starling
140e894bde Fixed the fact that defaults in template arguments {{{x|y}}} don't work when substing templates. Now defaults in triple braces will work in PST mode, except at the top (non-template) level. This is b/c breaking. 2008-01-30 02:52:14 +00:00
Tim Starling
db89122b89 * Fixed <!-- ~~~~ -->, added parser test
* Commented out memCheck()
2008-01-25 04:14:51 +00:00
Tim Starling
f748d710ee * Make lc and uc parser functions skip strip markers
* Made ==foo==<!----> create a valid section edit link
* Changed header processing heuristics -- now double-equals signs are generally respected as header starts, and will break template invocations, and single equals signs are respected as header syntax but might not generate a section edit link.
2008-01-24 09:07:47 +00:00
Tim Starling
906e978e91 * Factored out PPD "part" handling into its own class. Verified with differential fuzz test.
* Stabilise timestamps generated by the parser to avoid diff test false positives
* Fixed msgnw bug. Use RECOVER_ORIG.
* Fixed editintro bug. Cloning the parser in MessageCache has some side-effects that need to be corrected.
* Fixed typo in Parser_DiffTest.php
* General improvements to preprocessorFuzzTest.php
* Fixed breakage of XML output feature in Special:ExpandTemplates
2008-01-24 04:29:56 +00:00
Tim Starling
8404b249ad Postcard from linuxland.
* Reduced stack depth by using an internal stack in expand(), and by having some common code paths (e.g. non-subst double-brace during PST) return objects which can be expanded in that internal stack instead of the PHP stack. This is friendly to xdebug but slightly slower than the original version. Also it probably helps robustness when you don't add 7 stack levels per pair of double braces.
* Profiling indicates that expand and PPD are now good targets for porting to C. Abstracted and refactored the relevant code to allow for a drop-in replacement. A factor of 2 reduction in average-case replaceVariables() time may be possible.
* Verified with preprocessorFuzzTest.php against r29950, updated to allow better PST tests.
* Made parserTests.php respect $wgParserConf
* LST and ParserFunctions need a simultaneous update with the core due to changed interfaces. DOM objects are now wrapped rather than directly exposed.
2008-01-21 16:36:08 +00:00