Commit graph

75 commits

Author SHA1 Message Date
Shinjiman
fac96a1376 * Fixed the HTTP accept language string detection length in LanguageConverter.php, instead of the fixed length language codes.
patch by PhiLiP
2008-09-13 08:07:55 +00:00
Tim Starling
350b498b9f * Revert back to my parser pseudo-branch again. Note: if you feel like reverting this, reverting Parser.php alone to r40010 will work just fine.
* Merged replaceFreeExternalLinks() with doMagicLinks(). Makes a lot of sense, very similar operations, doesn't break any parser tests. Stops free links from interacting with other parser stages, the same way ISBN links don't. 
* The pass order change fixes Brion's complaint in r39980. Early link expansion, triggered by having more than 1000 links in the page, was outputting URLs which were destroyed by RFEL. Added parser test.
* Fixed an unrelated bug in LinkHolderArray::replace(): if a link to a redirect appears in two separate RLH calls, the second and subsequent calls do not add the mw-redirect class. Caused by an unmigrated LinkCache fetch.
* Added a parser test for a pass interaction bug that the pass order change fixes.
* The fuzzer told me to tell you that free external links in non-caption image parameters, which are and have always been invisible, are now not registered either.
* Miscellaneous supporting updates to the test infrastructure.
2008-08-26 14:37:15 +00:00
Brion Vibber
c83882e96e Revert r39949 "* Revert revert r39662 of my parser changes."
Causes weird regressions on http://meta.wikimedia.org/wiki/Talk:Spam_blacklist
Couldn't isolate to a parser test in a few minutes; some kind of template interaction perhaps.

Sample bad HTML like:
The associated page is used by the Mediawiki <a href="&lt;a href=" class="external free" title="http://www.mediawiki.org/wiki/Extension:SpamBlacklist" rel="nofollow">http://www.mediawiki.org/wiki/Extension:SpamBlacklist</a>" class="extiw" title="mw:Extension:SpamBlacklist"&gt;Spam Blacklist extension, and lists strings of text that may not be used in URLs in any page in Wikimedia Foundation projects (as well as many external wikis). Any meta <a href="/wiki/Administrator" title="Administrator">administrator</a> can edit the spam blacklist. There is also a more aggressive way to block spamming through direct use of <a href="/wiki/Anti-spam_features#.24wgSpamRegex" title="Anti-spam features">$wgSpamRegex</a>. Only <a href="/wiki/Developers" title="Developers" class="mw-redirect">developers</a> can make changes to $wgSpamRegex, and its use is to be avoided whenever possible.
2008-08-25 22:19:50 +00:00
Alexandre Emsenhuber
05b0fbd558 (bug 15303) Title conversion for templates wasn't working in some cases 2008-08-25 18:06:54 +00:00
Tim Starling
ccacba9f3a * Revert revert r39662 of my parser changes.
* Fixed image link whitespace handling (Brion's complaint, r39662)
* Added fuzz test capability to parserTests.php
* Added __destruct() functions to Parser and Language, and called them explicitly from parserTests.inc, to avoid unconstrained memory usage during fuzz testing.
* Added unified diff to output of Parser_DiffTest
* Fixed whitespace change in Parser::doTableStuff() (found by fuzzing)
* Added feature to RELEASE-NOTES which I'd committed last time but forgotten to note: <gallery> will accept image names with no "Image:" prefix (rediscovered by fuzzing)
* Limit memory usage in Title::getInterwikiLink()
* Fixed chronic fail of all interwiki link parser tests (hid Siebrand's complaint, r39464)
* Fixed chronic fail of one of the LanguageConverter parser tests. Was actually an ignored bug.
2008-08-25 16:08:19 +00:00
Shinjiman
d3f7a35bdf sequel of r38784, adding the test case for the 'submit' action
patch by PhiLiP
2008-08-16 10:09:18 +00:00
Shinjiman
8d06ad6ee3 * Added $wgDisableTitleConversion to disabling the conversion for all pages on the wiki (this one is useful for some wikis that do not need the title conversion for the entire wiki like Wiktionary)
* Added 'noconvertlink' toogle that can be set per user preferences, also added 'convertlink=no|yes' on GET requests whether have the link titles being converted or not
  patches by PhiLiP
2008-08-07 14:26:34 +00:00
Robert Stojnić
0ce3c66acd Fix regreesion in r37662, disabled conversion when interface language variant is different that main wiki language variant. 2008-07-15 16:49:57 +00:00
Robert Stojnić
1e26c77749 Sequel to r37662: avoid infinite recursion in User when default params are used. 2008-07-14 22:20:31 +00:00
Robert Stojnić
098cfc3c3b * (bug 10837) Language variants overrides languages other than the variant main language.
Explicitely forbid conversion when interface language is different than the main content language.
2008-07-14 21:32:13 +00:00
Shinjiman
3a622301ce some tweaks for the Language Converter
patch by fdcn
2008-07-10 13:56:23 +00:00
Shinjiman
90628b9c48 * (bug 14604) Update LanguageConverter for compatibility on -{*|xxx}- usage
patch by fdcn
2008-07-09 08:16:39 +00:00
Shinjiman
292f8462e8 * tweak some -{}- parsings
* adding namespace aliases for the Chinese language (zh)
  patches by fdcn
2008-07-08 02:34:11 +00:00
Tim Starling
ec614b6c68 Fixed two bugs in LanguageConverter, introduced in the last few commits, causing -{text}- to incorrectly generate an error. 2008-07-07 01:12:15 +00:00
Robert Stojnić
3e1c8acb67 (bug 14604#c6): Fix regression in variant conversion when semicolon is within -{}- tags. Patch by fdcn, thanks! 2008-07-06 17:23:00 +00:00
Shinjiman
6dc2f67fff * Re-implement the message caches for r35821
* Tweaked the message fetching on the MediaWiki:Conversiontable/xx-xx by changes of the message caching
  patch by Nikerabbit
2008-07-05 15:39:10 +00:00
Shinjiman
b61621a92a fix encoding problems on r37058 2008-07-04 15:17:40 +00:00
Shinjiman
ea3b78eb62 * (bug 14604) Update LanguageConverter for T (Title) conversion
bugzilla attachment 5048
  patch by fdcn
* Localisation updates Cantonese, Chinese and Old/Late Time Chinese
2008-07-04 15:01:41 +00:00
Brion Vibber
3f8faf178c cleanup -- remove added commented-out line 2008-07-02 02:05:28 +00:00
Shinjiman
9bfe56aa37 fixing encoding problems on r36664
patch by fdcn
2008-06-27 15:08:07 +00:00
Shinjiman
69dbeb97f1 * (bug 14604) Introduced the following features for the LanguageConverter: Multi-tag support, single conversion flag, remove conversion flag on a single page, description flag, variant name, multi-variant fallbacks.
patch by fdcn
* Added zh-mo and zh-my variants for the zh language
2008-06-26 03:00:34 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Robert Stojnić
65381965e4 The Horrible Twin for r28127. The call happens when content is fetched from
parser cache, and the title needs converting. A consequence of returning ''
is bad regexp that produces odd conversion behavior for titles reported on
various occasions.

One of these days, I'm just going to completely rewrite this thing, I swear!
2008-05-09 22:21:37 +00:00
Raimond Spekking
dc161492db * (bug 12145) Update Kazakh translations
Patch by AlefZet
2007-12-17 15:31:32 +00:00
Shinjiman
640d73a46b * (bug 12145) Update Kazakh translations, adding kk-variants
Patch by AlefZet
2007-12-09 16:24:35 +00:00
Tim Starling
c2178d0a11 Bump translation table cache version, since new tables have been added. Generates fatal errors if not done. 2007-12-03 04:54:28 +00:00
Rob Church
6af49f93c1 * Pass new Revision to the 'ArticleInsertComplete' and 'ArticleSaveComplete' hooks; see docs/hooks.txt for more information
* Document 'ArticleInsertComplete' hook
2007-07-22 23:16:48 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Antoine Musso
f1bbf8a3ff use parser->getTitle() to get possible private $parser->mTitle 2007-01-17 22:57:06 +00:00
Nick Jenkins
0c136554ef For the "languages/" directory :
* removing unused global declarations.
* adding one or two if/else braces.
* adding one or two array declarations.
2007-01-12 07:26:32 +00:00
Robert Stojnić
e8d4ca0af2 String length check to avoid warnings for empty strings... 2007-01-06 23:20:40 +00:00
Robert Stojnić
36eac0c7b5 Introduce 'R' flag for -{}- tags. The flagged text will not be parsed
for alternatives syntax, but just outputed. Use this to wrap math.
2007-01-03 14:37:15 +00:00
Robert Stojnić
93bf334b32 Allow -{}- tags to be stripped even when content is not converted
(i.e. $mDoContentConvert is false)
2007-01-02 22:59:11 +00:00
Robert Stojnić
5b2a644f2e More lang variant stuff:
* More parser tests, also added 'variant' option for testing
* Add global $wgDefaultLanguageVariant, can be used to set a default
  fallback variant
* Restructured some of the parser code in LanguageConverter, fix flag
  processing and add some comments to despookify the old zh code :)
* Cleanup of some old hacks in LanguageSr and Kk (do not use the global 
  title object, but the one passed to the parser)
2007-01-01 17:20:19 +00:00
Brion Vibber
12fedb75ff * Make variant table caching a little more robust, using main language code
in cache key. Probably this is still a bit wonky, though. Was breaking
  parser tests when Chinese tables were getting loaded into Serbian code.
2006-12-27 01:49:09 +00:00
Robert Stojnić
21a9d83443 More language variant stuff:
* Added some basic parser tests for variants
* Enable selflinks to be written in variants
* Prevent username lookup in variants for sr.wiki (per community request)
* Update release notes (also notes for last commit, when I forgot)
2006-12-26 12:19:45 +00:00
Robert Stojnić
a9929a4ebd Be more cautious about using _SERVER['SCRIPT_NAME'] in /variant/Title syntax. 2006-12-14 02:16:49 +00:00
Robert Stojnić
66999c01a4 * Enable category names to be written in variants (use single linkbatch for both link and category variants)
* introduce armourMath(), use to put -{ }- around math if needed (not needed for zh, but needed for sr, and probably kk)
2006-12-11 23:33:27 +00:00
Tim Starling
2f12a58d93 * Introduced StringUtils.php, populated it with some generic string functions, both new and collected from various other files.
* Removed some backtracking regexes with an O(N^2) worst case, replaced with StringUtils::delimiterReplace(). There is a beneficial functional difference: /*/ is no longer considered to be a complete CSS comment.
* Changed the parser strip state from an array to an object. This should hopefully avoid the PHP bugs with array references. StripState uses the new ReplacementArray to do the replacements, thereby supporting FSS. 
* Removed DatabaseFunctions.php from the default startup sequence. Moved wfGetDB() to GlobalFunctions.php.
* Introduced the SiteStats class, with a collection of cached site stats accessor functions.
* Removed all global functions from Parser.php, they don't belong there.
* Made LanguageConverter use the new ReplacementArray class instead of managing its own FSS objects.
2006-11-21 09:53:45 +00:00
Rotem Liss
95064a38ca (bug 6706) Kazakh language variants (cyrillic-latin-arabic script conversion, language and messages files) 2006-11-06 17:46:58 +00:00
Tim Starling
135dfa0e63 profiling 2006-10-16 03:16:12 +00:00
Tim Starling
3d249cc9a7 fix FSS-related bug 2006-10-16 02:36:28 +00:00
Robert Stojnić
45a3b669cc Commiting diff -r 16826:16966 of serbianvariants.
Enable engine for aliases like /sr-ec/Article_title
Put variants into google sitemap.
2006-10-12 10:34:49 +00:00
Brion Vibber
bcf5bfb35f Revert r16860
Appears to be placing variant URLs into the main article space,
creating URL ambiguity and probably cache problems.
2006-10-09 00:28:40 +00:00
Robert Stojnić
59c03118f8 Merged r16826-16858 of branches/SerbianVariants.
Enabled aliased variants e.g. ?title=Article&variant=sr-ec => /sr-ec/Article
and added variants to google sitemap. 
To enable aliases put: $wgVariantArticlePath = "$wgScriptPath/$2/$1";
to LocalSettings.php, and make aliases from /$variants/ to index.php
2006-10-08 13:37:08 +00:00
Tim Starling
e174a4ddfb Abolished $wgDBname as a unique wiki identifier, it doesn't work with the new-fangled feature we call "table prefixes". Instead use wfWikiID() for an identifier containing the DB name and the prefix if there is one, and wfMemcKey() for cache key construction.
Caches for wikis with table prefixes will be lost on upgrade, caches for wikis without table prefixes will be preserved. Custom cache keys in extensions can be migrated at leisure. Extensions which write to core cache keys should be migrated ASAP, as I have done with Special:Makesysop.
2006-10-04 09:06:18 +00:00
Brion Vibber
61b04a3e95 * Updates to language variant code for Serbian et al 2006-09-20 10:22:12 +00:00
Brion Vibber
a38c8add84 reverting SerbianVariants check-in, not ready to go live yet on Wikimedia 2006-09-15 21:02:35 +00:00
Brion Vibber
1657774656 Merge from SerbianVariants branch, trunk 16500 vs SerbianVariants 16523 2006-09-15 20:08:21 +00:00