Commit graph

265 commits

Author SHA1 Message Date
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/ /\ /g;s/—/―/g;s/•/•/g;s/á/á/g;s/´/´/g;s/à/à/g;s/α/α/g;s/ä/ä/g;s/ç/ç/g;s/©/©/g;s/↓/↓/g;s/°/°/g;s/é/é/g;s/ê/ê/g;s/ë/ë/g;s/è/è/g;s/€/€/g;s/↔//g;s/…/…/g;s/í/í/g;s/ì/ì/g;s/←/←/g;s/“/“/g;s/·/·/g;s/−/−/g;s/–/–/g;s/ó/ó/g;s/ô/ô/g;s/œ/œ/g;s/ò/ò/g;s/õ/õ/g;s/ö/ö/g;s/£/£/g;s/′/′/g;s/″/″/g;s/»/»/g;s/→/→/g;s/”/”/g;s/Σ/Σ/g;s/×/×/g;s/ú/ú/g;s/↑/↑/g;s/ü/ü/g;s/¥/¥/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