lhc/web/wiklou.git
12 years agoAs discussed in r85918 CR. Move everything from wfIndexMain() at index.php to MediaWi...
Platonides [Sat, 18 Jun 2011 14:50:26 +0000 (14:50 +0000)]
As discussed in r85918 CR. Move everything from wfIndexMain() at index.php to MediaWiki class.
This makes index.php compatible again with PHP4 (as in showing a nice error message
instead of a parser error), which had been broken in r88959.

12 years agoAddress comment by Platonides on r90320:
Robin Pepermans [Sat, 18 Jun 2011 14:49:01 +0000 (14:49 +0000)]
Address comment by Platonides on r90320:
* undefined variable $list in CategoryPage.php
* move code in ParserOptions to a new member of Title class, which falls back to $wgContLang

12 years agoFollow up r90320. The purpose of wfProfileIn/Out is to profile
Platonides [Sat, 18 Jun 2011 14:01:12 +0000 (14:01 +0000)]
Follow up r90320. The purpose of wfProfileIn/Out is to profile
the contents of the function. So it shall be the last instruction.

12 years agoFollow-up to r90265: directionality improvements as part of bug 6100 (under $wgBetter...
Robin Pepermans [Sat, 18 Jun 2011 13:12:52 +0000 (13:12 +0000)]
Follow-up to r90265: directionality improvements as part of bug 6100 (under $wgBetterDirectionality):
* Correct directionality when viewing diffs
* Correct arrows for Pager
* CSS/JS pages always 'en' (LTR)
* Messages on Special:Allmessages have lang and dir attributes based on the selected language

12 years agoImplement mw.Title in core
Krinkle [Sat, 18 Jun 2011 09:17:09 +0000 (09:17 +0000)]
Implement mw.Title in core

* Based on UploadWizard/resources/mw.Title.js

* Refactored to use local scope and prototypes instead of re-declaring them per-instance in the private scope through 'this' (re-use by reference, faster instantiation and performance)

* Fix potential ReferenceError in the check for wgArticlePath (inline if statements will fail for undeclared variables, needs typeof undefined check). Using mw.config instead to avoid this problem.

* The following two methods were not ported from UploadWizard because they were or became redundant and/or merged with another method:
-- setNameText (redundant with the improved setName)
-- setPrefix (redundant wit the improved setNamespace)

* Ported all jasmine tests to QUnit. Left them exactly the same to make sure it's compatible with UploadWizard. Perhaps I'll expand or adjust the suite later to be less file-specific, but for now make letting this revision go through TestSwarm to be sure it's compatible and behaves exactly the same.

* Added getName() method instead, replacing direct access to '_name' This in order to check for wgCaseSensitiveNamespaces (bug 29441; r90234)
-- Prevents breakages on wiktionary and other wikis with case sensitivity. ie. on a Wiktionary:
new mw.Title('apple').toString()
> "Apple"
-- This fix will make it return 'apple' instead of 'Apple' (that is, if 0 is in wgCaseSensitiveNamespaces).

* There used to be a strip-bug in scenarios where a namespace-like string appears inside of a title. Imagine pagename: "Category:Wikipedia:Foo bar" (exist on several wikis; NS_CATEGORY= 14)

new mw.Title( 'Wikipedia:Foo bar', 14 ).toString()
> "Category:Foo_bar" // Stripped "Wikipedia:" !!

In order to fix this:
-- Removed assumption that every title has a namespace prefix. UploadWizard/mw.Title has one initialization RegExp (which was ported as-is to "setAll"). In addition there is now a "setNameAndExtension" method (which doesn't extract or set the namespace). Now the above case:

new mw.Title( 'Wikipedia:Foo bar', 14 ).toString()
> "Category:Wikipedia_Foo_bar" // Better, but now the colon is gone..

-- In order to fix that, "\x3a" was removed from the clean() function. Colons are valid in MediaWiki titles, no need to escape.

new mw.Title( 'Wikipedia:Foo bar', 14 ).toString()
> "Category:Wikipedia:Foo_bar" // Yay!

* Last but not least, another little bug fixed due to the previous point. It also fixed a thrown exception in case a colon is part of the title in the main namespace (not rare for movies and books):

new mw.Title( 'The Wiki: Awesomeness')
> Error: mw.Title> Unrecognized canonical namespace: the_wiki

This exception is thrown from setNamespace(). That exception would make sense if setNamespace() was called by the user direcly, but when called from setAll() it should gracefully fallback by putting the prefix in the name instead and assuming NS_MAIN (just like the server side does). To achieve this I added a try/catch around setAll() and fallback to the new setNameAndExtension().

* Passes JSHint.

* Additional feature: exists(). Return true/false if known, otherwise null. Extensions can populate this for titles they are interested in and the front-end can construct url's and UI elements with correct redlink-status. Gadgets can populate it as well but that would require an API-request to get the information. A bit of a stub for later use, although I think it works fine.

* Bugfix in jquery.qunit.completenessTest.js (first triggered by the introduction of mw.Title). Don't traverse the 'constructor' property (recursive loop, ouch!)

---

(bug 29397) Implement mw.Title module in core

12 years agofix invocation of static function
Neil Kandalgaonkar [Sat, 18 Jun 2011 03:36:44 +0000 (03:36 +0000)]
fix invocation of static function

12 years agoTweaked comments and code in confusing spot of doAutoblock()
Aaron Schulz [Sat, 18 Jun 2011 00:29:32 +0000 (00:29 +0000)]
Tweaked comments and code in confusing spot of doAutoblock()

12 years agogenerate random triangles (so we can test EXIF orientation, eventually)
Neil Kandalgaonkar [Fri, 17 Jun 2011 23:26:45 +0000 (23:26 +0000)]
generate random triangles (so we can test EXIF orientation, eventually)

12 years agoFollow-up to r90265: directionality improvements as part of bug 6100 (under $wgBetter...
Robin Pepermans [Fri, 17 Jun 2011 21:48:43 +0000 (21:48 +0000)]
Follow-up to r90265: directionality improvements as part of bug 6100 (under $wgBetterDirectionality):
* Use ParserOptions()->getTargetLanguage() for setting the page language/direction
* Set headings on categories in user language/direction
* Only set language/direction when viewing a page (or editing but only preview and textarea)

12 years agoskip gzip tests if gzip is turned off
Ryan Kaldari [Fri, 17 Jun 2011 21:15:24 +0000 (21:15 +0000)]
skip gzip tests if gzip is turned off

12 years agoless confusing error message
Ryan Kaldari [Fri, 17 Jun 2011 20:58:36 +0000 (20:58 +0000)]
less confusing error message

12 years agoFix type in code doc from r82433
Max Semenik [Fri, 17 Jun 2011 20:02:39 +0000 (20:02 +0000)]
Fix type in code doc from r82433

12 years agoLocalisation updates for core and extension messages from translatewiki.net (2011...
Raimond Spekking [Fri, 17 Jun 2011 19:27:16 +0000 (19:27 +0000)]
Localisation updates for core and extension messages from translatewiki.net (2011-06-17 19:08:00 UTC)

12 years agoRemove unneeded div with dir on Special:Version. It used to be English-only (LTR...
Robin Pepermans [Fri, 17 Jun 2011 18:11:15 +0000 (18:11 +0000)]
Remove unneeded div with dir on Special:Version. It used to be English-only (LTR-only) and was changed in r51839 but it inherits the page directionality anyway.

12 years agoIn wfBacktrcae(): print "->" or "::" whether the function was called dynamically...
Alexandre Emsenhuber [Fri, 17 Jun 2011 17:13:43 +0000 (17:13 +0000)]
In wfBacktrcae(): print "->" or "::" whether the function was called dynamically or statically instead of always "::"

12 years agoFix r85635. Move LocalFile::publish() magic to LocalFile::publishTo() which has an...
Bryan Tong Minh [Fri, 17 Jun 2011 17:12:20 +0000 (17:12 +0000)]
Fix r85635. Move LocalFile::publish() magic to LocalFile::publishTo() which has an explicit $destRel argument.

12 years agoPer comments on r88145: unlink file if it is broken
Bryan Tong Minh [Fri, 17 Jun 2011 16:48:42 +0000 (16:48 +0000)]
Per comments on r88145: unlink file if it is broken

12 years agoPer comments revert r88904 and remove session_write_close entirely. This will leave...
Bryan Tong Minh [Fri, 17 Jun 2011 16:42:58 +0000 (16:42 +0000)]
Per comments revert r88904 and remove session_write_close entirely. This will leave async uploads broken until somebody writes a way to interact with the session per comments on r87235.

12 years agoRemoved useless check for existence of wfWaitForSlaves()
Alexandre Emsenhuber [Fri, 17 Jun 2011 16:39:21 +0000 (16:39 +0000)]
Removed useless check for existence of wfWaitForSlaves()

12 years agoSwap else if for elseif
Sam Reed [Fri, 17 Jun 2011 16:05:35 +0000 (16:05 +0000)]
Swap else if for elseif

Trimming trailing whitespace also

Doing in 3 commits (3/3), so hopefully reviewable in CR...

12 years agoSwap else if for elseif
Sam Reed [Fri, 17 Jun 2011 16:05:05 +0000 (16:05 +0000)]
Swap else if for elseif

Trimming trailing whitespace also

Doing in 3 commits (2/3), so hopefully reviewable in CR...

12 years agoSwap else if for elseif
Sam Reed [Fri, 17 Jun 2011 16:03:52 +0000 (16:03 +0000)]
Swap else if for elseif

Trimming trailing whitespace also

Doing in 3 commits, so hopefully reviewable in CR...

12 years agoFix trailing whitespace
Sam Reed [Fri, 17 Jun 2011 15:59:55 +0000 (15:59 +0000)]
Fix trailing whitespace

12 years ago* (bug 25133) allow redirects also for action=parse&pageid
Sam Reed [Fri, 17 Jun 2011 15:57:00 +0000 (15:57 +0000)]
* (bug 25133) allow redirects also for action=parse&pageid

12 years agoFollowup r89539, per CR, we don't need to append iw string as it already exists in...
Sam Reed [Fri, 17 Jun 2011 15:24:40 +0000 (15:24 +0000)]
Followup r89539, per CR, we don't need to append iw string as it already exists in rawTitleStr

12 years agoAdd setOuput method
Sam Reed [Fri, 17 Jun 2011 15:07:51 +0000 (15:07 +0000)]
Add setOuput method

12 years agoRelated to bug 29278, and from the comments in bug 14210, mention the edit token...
Sam Reed [Fri, 17 Jun 2011 14:55:03 +0000 (14:55 +0000)]
Related to bug 29278, and from the comments in bug 14210, mention the edit token should be sent last/after the text parameter

12 years agoEmpower our Database object so that it is possible to perform NOT NULL queries (SELEC...
Platonides [Fri, 17 Jun 2011 14:54:41 +0000 (14:54 +0000)]
Empower our Database object so that it is possible to perform NOT NULL queries (SELECT abc WHERE xyz IS NOT NULL)

12 years agoFix more __get() calls on RequestContext
Sam Reed [Fri, 17 Jun 2011 13:27:39 +0000 (13:27 +0000)]
Fix more __get() calls on RequestContext

12 years agoImprove lang and dir of content div (when $wgBetterDirectionality is enabled):
Robin Pepermans [Fri, 17 Jun 2011 11:49:37 +0000 (11:49 +0000)]
Improve lang and dir of content div (when $wgBetterDirectionality is enabled):
* Do not set lang and dir for special pages (those are in the user language)
* Set lang and dir of content of pages in MediaWiki namespace based on the current page instead of site language, e.g. MediaWiki:Message/ar is lang="ar" and dir="rtl"

12 years ago(part of bug 6100) Set the directionality based on user language instead of content...
Robin Pepermans [Fri, 17 Jun 2011 11:32:42 +0000 (11:32 +0000)]
(part of bug 6100) Set the directionality based on user language instead of content language (as in r81622, but only when $wgBetterDirectionality is enabled)

12 years agoAdd release note for r89329 (renamed localisation 'roa-rup' to 'rup')
Robin Pepermans [Fri, 17 Jun 2011 10:49:39 +0000 (10:49 +0000)]
Add release note for r89329 (renamed localisation 'roa-rup' to 'rup')

12 years agoFixing up most of the magic get/set stuff
Sam Reed [Fri, 17 Jun 2011 10:29:39 +0000 (10:29 +0000)]
Fixing up most of the magic get/set stuff

12 years ago(29 lines skipped) [17-Jun-2011 10:03:59] PHP Notice: Use of RequestContext::__get...
Sam Reed [Fri, 17 Jun 2011 10:07:40 +0000 (10:07 +0000)]
(29 lines skipped) [17-Jun-2011 10:03:59] PHP Notice:  Use of RequestContext::__get() is deprecated; use $context->getFoo() instead is  deprecated. [Called from MediaWiki::parseTitle in /www/w/includes/Wiki.php at line 36] in /www/w/includes/GlobalFunctions.php on line 3342

Swap $this->context->request to $this->context->getRequest()

12 years agorevert r87808 - Its broken, and looks rather complex to fix, especially with namespac...
Brian Wolff [Fri, 17 Jun 2011 03:56:21 +0000 (03:56 +0000)]
revert r87808 - Its broken, and looks rather complex to fix, especially with namespace aliases.

See comments on r87808 for details.

12 years ago(follow-up r86567) per CR rename the class JpegOrTiffHandler to ExifBitmapHandler.
Brian Wolff [Fri, 17 Jun 2011 03:37:59 +0000 (03:37 +0000)]
(follow-up r86567) per CR rename the class JpegOrTiffHandler to ExifBitmapHandler.

12 years agoMinor doc fix to r84741
Sam Reed [Thu, 16 Jun 2011 23:40:13 +0000 (23:40 +0000)]
Minor doc fix to r84741

Remove unreachable code from WatchAction

Documentation added to Init.php

12 years agofollow up r84134 — removing passing $this by reference
Mark A. Hershberger [Thu, 16 Jun 2011 23:36:41 +0000 (23:36 +0000)]
follow up r84134 — removing passing $this by reference

12 years agostray tab removal
Mark A. Hershberger [Thu, 16 Jun 2011 23:35:23 +0000 (23:35 +0000)]
stray tab removal

12 years agoFix Bug #28344 - “Links doesn't work inside collapsible toggles”
Mark A. Hershberger [Thu, 16 Jun 2011 22:27:22 +0000 (22:27 +0000)]
Fix Bug #28344 - “Links doesn't work inside collapsible toggles”
Patch from mybugs.mail

    If a link is added inside of a collapsible toggle and a user click on it, the
    target page should be opened.
    …
    The attached patch was tested locally and fixes this bug (clicking outside the
    link toogles the collapsed content, and clicking on the link opens the target
    page).

    PS: It is the same code which was used to fix the problem on Commons.

    http://commons.wikimedia.org/w/index.php?diff=45383826&oldid=45265712

12 years agoRelease-notes for r90234
Krinkle [Thu, 16 Jun 2011 21:22:51 +0000 (21:22 +0000)]
Release-notes for r90234

12 years ago(bug 29441) Expose CapitalLinks config in JS to allow modules to properly handle...
Krinkle [Thu, 16 Jun 2011 21:20:05 +0000 (21:20 +0000)]
(bug 29441) Expose CapitalLinks config in JS to allow modules to properly handle titles on case-sensitive wikis.

This brings us one step closer towards:
(bug 29397) Implement mw.Title module in core

12 years agoRevert r90232.
Krinkle [Thu, 16 Jun 2011 21:18:40 +0000 (21:18 +0000)]
Revert r90232.

12 years agoImplement mw.Title in core
Krinkle [Thu, 16 Jun 2011 21:16:50 +0000 (21:16 +0000)]
Implement mw.Title in core
* Based on UploadWizard/resources/mw.Title.js
* Refactored to use local scope and prototypes instead of per-instance private scope (less references, faster instantiation)
* Fix potential ReferenceError in the check for wgArticlePath (inline if statements will fail to evaluate for undeclared variables). Using mw.config instead
* The following were not ported because they are or were already redundant and/or merged with another method:
-- setNameText (redundant with the improved setName)
-- setPrefix (redundant wit the improved setNamespace)
* Ported all jasmine tests to QUnit. Left them exactly the same to make sure it's compatible with UploadWizard. Perhaps I'll expand or adjust the suite later to be less file-specific, but for now make sure it's compatible and the same.

@todo FIXME

* Removed assumption that every title has a namespace prefix in it by creating a separate RegExp when there is a namespace given

** Fixes strip-bug in cases where a namespace appears to be part of a title when the namespace is also given: "Project:User:Foobar"

new mw.Title( 'User:Foobar', 4 ).toString()
> 'Project:Foobar'

** Fixes a thrown exception in case a colon is part of the title (colons are valid in MediaWiki pagenames!)

new mw.Title( 'Just some:Random page')
> Error: mw.Title> Unrecognized canonical namespace: just_some

* Added check for capitalLinks et (wasn't possible before due to bug X)

** Prevents breakages on wiktionary and other wikis with case sensitivity.

12 years agoCopy teardownUploadDir(),deleteFiles(),deleteDirs() from parserTest.inc Move down...
Platonides [Thu, 16 Jun 2011 21:07:37 +0000 (21:07 +0000)]
Copy teardownUploadDir(),deleteFiles(),deleteDirs() from parserTest.inc Move down teardownGlobals()
This almost fixes the issue of hundreds of leaking mwParser-*-images files at temp dir.
For some unknown reason, there's still one instance left, though.

PS: I thought I had committed this time ago...

12 years agoMark as needing a db.
Platonides [Thu, 16 Jun 2011 21:06:11 +0000 (21:06 +0000)]
Mark as needing a db.
Remove double data insertion

12 years agoRemove trailing newline from pass, which is very unlikely to be intended.
Platonides [Thu, 16 Jun 2011 21:01:52 +0000 (21:01 +0000)]
Remove trailing newline from pass, which is very unlikely to be intended.

12 years agoAllow to provide the db password inside a file instead of using
Platonides [Thu, 16 Jun 2011 20:58:12 +0000 (20:58 +0000)]
Allow to provide the db password inside a file instead of using
the command line, so that it isn't exposed in the process list.

Sadly, use of /dev/stdin or <(process) doesn't work in Linux,
since they are shown as symlinks to pipe:[12345678] and php
dereferences all of them. It has to be a real file.
However, such constructs work in Solaris, where they are
presented as character devices.

12 years agoFix indenting
Sam Reed [Thu, 16 Jun 2011 20:57:31 +0000 (20:57 +0000)]
Fix indenting

12 years agoPer ^demon, added entry for r87557 (removal of LogPageValidTypes, LogPageLogName...
Alexandre Emsenhuber [Thu, 16 Jun 2011 20:21:53 +0000 (20:21 +0000)]
Per ^demon, added entry for r87557 (removal of LogPageValidTypes, LogPageLogName, LogPageLogHeader and LogPageActionText hooks)

12 years agoGroupped URL-related functions
Alexandre Emsenhuber [Thu, 16 Jun 2011 19:09:03 +0000 (19:09 +0000)]
Groupped URL-related functions

12 years ago* (bug 29426) Fix wrong use of Block::load's second parameter in BlockTest
Brion Vibber [Thu, 16 Jun 2011 17:58:26 +0000 (17:58 +0000)]
* (bug 29426) Fix wrong use of Block::load's second parameter in BlockTest

It was accidentally passing a username where it should have passed a user ID, causing PostgreSQL's stricter comparisons to fail, while MySQL's allowed it to run without complaint but returned bad results.
Of course that bug got hidden by the test.... testing the wrong thing... :)

Now correctly loads using the user id instead of name, checks the proper return values, and actually compares the right object.

12 years agoRemoved usage of error suppression operator
Alexandre Emsenhuber [Thu, 16 Jun 2011 17:38:26 +0000 (17:38 +0000)]
Removed usage of error suppression operator

12 years ago* (bug 29091) Fix form of native name for Ossetic language (Иронау -> Ирон)
Brion Vibber [Thu, 16 Jun 2011 17:34:40 +0000 (17:34 +0000)]
* (bug 29091) Fix form of native name for Ossetic language (Иронау -> Ирон)

12 years agoRevert r88988
Platonides [Thu, 16 Jun 2011 16:54:06 +0000 (16:54 +0000)]
Revert r88988

13 years agoFixes for r90105, r90193:
Tim Starling [Thu, 16 Jun 2011 05:52:16 +0000 (05:52 +0000)]
Fixes for r90105, r90193:
* Actually removed $wgProto.
* Per Aryeh's suggestions on the future of $wgServer: made $wgServer detection in DefaultSettings.php more permanent by merging it with the new code from r90105. This means that bug 14977 is properly fixed now.
* Require entry points to set up the autoloader before including DefaultSettings.php. Comments on bug 14977 indicate that at some point in the past, this may have broken something. Anything that breaks now should just be fixed, we need the autoloader. Tested the most common entry points.
* Since the detection code has moved from Installer to WebRequest, I also moved the relevant test file and updated the test. The function under test is now public static, so r90154 is superseded.

13 years agoRemoved $wgProto. Previously, setting this undocumented global variable to anything...
Tim Starling [Thu, 16 Jun 2011 05:13:29 +0000 (05:13 +0000)]
Removed $wgProto. Previously, setting this undocumented global variable to anything other than the part of $wgServer before the first colon would cause various things to subtly screw up. Similarly, forgetting to set it when you override $wgServer in LocalSettings.php would break things too.

Exposing it in the default LocalSettings.php as I did in r90105 was not a good solution, really the only way to avoid breakage is to just get the protocol from $wgServer whenever you need the protocol.

Fixed $wgCookieSecure so that it will be enabled automatically if the user sets $wgServer to an https URL in LocalSettings.php. Added documentation for other cookie-related globals.

Grep indicates that $wgProto is not used by any extensions. $wgCookieSecure is used, hence the need for the Setup.php patch.

13 years agoFollowup to r89452, remove ftp test cases since Http::isValidUri() doesn't do ftp...
Chad Horohoe [Thu, 16 Jun 2011 02:58:00 +0000 (02:58 +0000)]
Followup to r89452, remove ftp test cases since Http::isValidUri() doesn't do ftp anymore

13 years agoAnother stub test file...this one has been like this since r72258
Chad Horohoe [Wed, 15 Jun 2011 23:24:23 +0000 (23:24 +0000)]
Another stub test file...this one has been like this since r72258

13 years agoAnother empty "Has not been implemented" test
Chad Horohoe [Wed, 15 Jun 2011 23:17:11 +0000 (23:17 +0000)]
Another empty "Has not been implemented" test

13 years agoAdd dummy assertion to shut up phpunit yelling about it
Chad Horohoe [Wed, 15 Jun 2011 23:15:36 +0000 (23:15 +0000)]
Add dummy assertion to shut up phpunit yelling about it

13 years agoFollowup 90161 (which breaks the test). Need to hack around to avoid a reload from db.
Platonides [Wed, 15 Jun 2011 21:32:08 +0000 (21:32 +0000)]
Followup 90161 (which breaks the test). Need to hack around to avoid a reload from db.

13 years agoDocument from r87129 summary
Platonides [Wed, 15 Jun 2011 21:23:47 +0000 (21:23 +0000)]
Document from r87129 summary

13 years agor87164 removed mDataLoaded and broke this test databaseless nature.
Platonides [Wed, 15 Jun 2011 21:22:08 +0000 (21:22 +0000)]
r87164 removed mDataLoaded and broke this test databaseless nature.

13 years agoMake sure to die if there are more MediaWikiLangTestCase::tearDowns than setUp()s...
Platonides [Wed, 15 Jun 2011 21:07:12 +0000 (21:07 +0000)]
Make sure to die if there are more MediaWikiLangTestCase::tearDowns than setUp()s (such as r90150 & r90155)

13 years agoFollow-up r90150, another parent::setUp missing.
Platonides [Wed, 15 Jun 2011 21:03:08 +0000 (21:03 +0000)]
Follow-up r90150, another parent::setUp missing.

13 years agoFollowup r90105, ReflectionMethod::setAccessible() requires PHP 5.3.2. Mark incomplet...
Chad Horohoe [Wed, 15 Jun 2011 20:57:13 +0000 (20:57 +0000)]
Followup r90105, ReflectionMethod::setAccessible() requires PHP 5.3.2. Mark incomplete otherwise

13 years agoFollowup to r90090 -- thou shalt add parent:: calls to both overridden tearDown ...
Brion Vibber [Wed, 15 Jun 2011 20:51:17 +0000 (20:51 +0000)]
Followup to r90090 -- thou shalt add parent:: calls to both overridden tearDown *and* overridden setUp ()

Had been resulting in fatal errors when running TimeAdjustTest, due to trying to use an old $wgContLang value that had never gotten saved properly because the parent class setUp() was not called.

13 years agoFix for BlockTest -- when setup ran multiple times, the block entry wouldn't get...
Brion Vibber [Wed, 15 Jun 2011 20:43:24 +0000 (20:43 +0000)]
Fix for BlockTest -- when setup ran multiple times, the block entry wouldn't get re-saved and we'd end up with null or 0 as our block id.
By first removing any matching block, we can re-insert it at will and have a fresh working block to test.

13 years agoAnother partial fix for Block test: update $this->mId on successful Block::insert()
Brion Vibber [Wed, 15 Jun 2011 20:42:16 +0000 (20:42 +0000)]
Another partial fix for Block test: update $this->mId on successful Block::insert()

13 years agoLocalisation updates for core and extension messages from translatewiki.net (2011...
Raimond Spekking [Wed, 15 Jun 2011 20:04:37 +0000 (20:04 +0000)]
Localisation updates for core and extension messages from translatewiki.net (2011-06-15 19:51:00 UTC)

13 years agoFix for partial regression in r84534: Block::newFromId was no longer handling the...
Brion Vibber [Wed, 15 Jun 2011 19:05:25 +0000 (19:05 +0000)]
Fix for partial regression in r84534: Block::newFromId was no longer handling the case where there was no matching row correctly. Now returns null.

This bug was showing up in test results like this:

  BlockTest::testInitializerFunctionsReturnCorrectBlock
  Trying to get property of non-object

  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:340
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:365
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:118
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/BlockTest.php:60
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60

However, that only triggers because the actual test is failing -- it's expecting to get a return back. This can only be reproduce when using the suite.xml configuration file, and not when running the BlockTest standalone.

13 years agoAlso check indexes in SQLite upgrade tests
Max Semenik [Wed, 15 Jun 2011 17:59:02 +0000 (17:59 +0000)]
Also check indexes in SQLite upgrade tests

13 years agoSQLite support for r86485
Max Semenik [Wed, 15 Jun 2011 17:57:00 +0000 (17:57 +0000)]
SQLite support for r86485

13 years agoBroke some long lines
Aaron Schulz [Wed, 15 Jun 2011 17:03:18 +0000 (17:03 +0000)]
Broke some long lines

13 years agoPer Brion, follow-up r86784: doucment that wfMsg() and related also accept message...
Alexandre Emsenhuber [Wed, 15 Jun 2011 16:33:13 +0000 (16:33 +0000)]
Per Brion, follow-up r86784: doucment that wfMsg() and related also accept message parameters as an array in the second parameter

13 years ago* (bug 28798) Set $wgServer in the default LocalSettings.php
Tim Starling [Wed, 15 Jun 2011 07:35:47 +0000 (07:35 +0000)]
* (bug 28798) Set $wgServer in the default LocalSettings.php
* (bug 14977) When detecting $wgServer, treat IPv6 addresses in $_SERVER['SERVER_NAME'] etc. in a sensible way.
* Tests for the new functions in IP.php and Installer.php

13 years agoUse camelCase, as pointed out by siebrand on r89731
Chad Horohoe [Wed, 15 Jun 2011 01:34:23 +0000 (01:34 +0000)]
Use camelCase, as pointed out by siebrand on r89731

13 years agoUsing true instead of calling isMainPage() again.
Krinkle [Wed, 15 Jun 2011 01:11:16 +0000 (01:11 +0000)]
Using true instead of calling isMainPage() again.

(Follow-up r90099 CR, Poke r87212)

13 years agoRevert r86764, r89134, r86827 -- added a second opaque boolean parameter to Linker...
Brion Vibber [Tue, 14 Jun 2011 23:50:40 +0000 (23:50 +0000)]
Revert r86764, r89134, r86827 -- added a second opaque boolean parameter to Linker::commentBlock() which appeared to mostly just turn it into Linker::formatComment().

commentBlock() exists for the sole purpose of embedding a comment into parentheses if it exists so you can append it to a line of text -- if you're not putting stuff in parentheses, don't use commentBlock() because you're not generating a parenthesized comment block.
Opaque boolean parameters are also very poor form, especially when tacking on multiple ones. There was already a nasty optional '$local' boolean param, forcing all uses of this other parameter to add *two* parameters, making illegible stuff like 'false, false'.

13 years agoOnly define 'isMainPage' if we are on the main page, the new mw.config library is...
Krinkle [Tue, 14 Jun 2011 23:29:45 +0000 (23:29 +0000)]
Only define 'isMainPage' if we are on the main page, the new mw.config library is specifically built for this efficient way of exporting variables as it will prevent any TypeError exceptions and simply return null (it's not a real global anymore).

This is a follow-up on Brion's CR at r87212.

13 years agoMerge conflict fix from r90096.
Krinkle [Tue, 14 Jun 2011 22:51:47 +0000 (22:51 +0000)]
Merge conflict fix from r90096.

13 years agowgNamespaceIds in JavaScript didn't include canonical namespaces. Adding them to...
Krinkle [Tue, 14 Jun 2011 22:49:38 +0000 (22:49 +0000)]
wgNamespaceIds in JavaScript didn't include canonical namespaces. Adding them to it, in a similar way that Language->getNamespaceIds does it for the localized namespaces and the namespace aliases.

Fixes bug in mw.Title constructor when .setNamespace() is used with a canonical namespace on a non-English content-language wiki.
Example: On a German wiki "var foo = new mw.Title('bar').setNamespace('file')" will throw an Error, as wgNamespaceIds only contains localized namespaces + namespace aliases, not canonical ones (in contrary to the assumption that has been made in various places).

(bug 25375) Add canonical namespaces to JavaScript "wgNamespaceIds"

13 years agoFollowup to r86347, r86797: change SpecialUndelete->mFile to mFilename to remove...
Brion Vibber [Tue, 14 Jun 2011 21:47:23 +0000 (21:47 +0000)]
Followup to r86347, r86797: change SpecialUndelete->mFile to mFilename to remove conflict with SpecialPage->mFile which carries different data and is now private.

13 years agofix for bug29371 . regex wordwrap with UTF8: do not use \b metacharacter. The problem...
Thomas Gries [Tue, 14 Jun 2011 21:42:25 +0000 (21:42 +0000)]
fix for bug29371 . regex wordwrap with UTF8: do not use \b metacharacter. The problem is that JavaScript recognizes word boundaries only before/after ASCII letters (and numbers/underscore)

13 years agoBlockTest changes $wgContLang, too.
Platonides [Tue, 14 Jun 2011 21:27:07 +0000 (21:27 +0000)]
BlockTest changes $wgContLang, too.

13 years agoThou shall call parent::tearDown(), MediaWikiLangTestCase child.
Platonides [Tue, 14 Jun 2011 21:21:26 +0000 (21:21 +0000)]
Thou shall call parent::tearDown(), MediaWikiLangTestCase child.
Follow up r87210. This has been hurting my tests for weeks.

Made TimeAdjustTest extend MediaWikiLangTestCase.

13 years agomakeCollapsible fix for jQuery 1.6.1
Krinkle [Tue, 14 Jun 2011 21:20:30 +0000 (21:20 +0000)]
makeCollapsible fix for jQuery 1.6.1
* Pre 1.6, jQuery returned an empty string for attributes that were not set. Although in a way that was wrong, it was the way it was. From jQuery documentation: "As of jQuery 1.6, the .attr() method returns <code>undefined</code> for attributes that have not been set." [1]
** Fixing makeCollapsible by removing empty-string checks and casting to boolean instead
* Wrapped a long line

[1] http://api.jquery.com/attr/

(jQuery 1.6.1 upgrade was in r89866)

13 years agoFix one bad doc comment entry from r86848
Brion Vibber [Tue, 14 Jun 2011 21:10:33 +0000 (21:10 +0000)]
Fix one bad doc comment entry from r86848

13 years agoRevert r86897 in wfMakeUrlIndex() and solve the issue in wfParseUrl()
Platonides [Tue, 14 Jun 2011 20:57:42 +0000 (20:57 +0000)]
Revert r86897 in wfMakeUrlIndex() and solve the issue in wfParseUrl()

13 years agoFollowup to r86942 per CR comments: instanceof Array -> $.isArray (safer, more cross...
Brion Vibber [Tue, 14 Jun 2011 20:55:39 +0000 (20:55 +0000)]
Followup to r86942 per CR comments: instanceof Array -> $.isArray (safer, more cross-browser)

13 years agoLocalisation updates for core and extension messages from translatewiki.net (2011...
Raimond Spekking [Tue, 14 Jun 2011 20:52:22 +0000 (20:52 +0000)]
Localisation updates for core and extension messages from translatewiki.net (2011-06-14 20:30:00 UTC)

13 years agoIncreasing time-out (testswarm reports false positives from swarmiers with a slower...
Krinkle [Tue, 14 Jun 2011 20:02:51 +0000 (20:02 +0000)]
Increasing time-out (testswarm reports false positives from swarmiers with a slower connection). Follow-up r89247

13 years agoRemove redundant mediawiki.util directory
Krinkle [Tue, 14 Jun 2011 17:44:02 +0000 (17:44 +0000)]
Remove redundant mediawiki.util directory

13 years agoPer Nikerabbit, fixes for r89176:
Alexandre Emsenhuber [Tue, 14 Jun 2011 15:08:52 +0000 (15:08 +0000)]
Per Nikerabbit, fixes for r89176:
* correct variable name in preprocessorFuzzTest.php
* Added type hints in Parser's test methods

13 years agoFU r89545: change broke api watching by switching watch and unwatch around.
Niklas Laxström [Tue, 14 Jun 2011 13:10:26 +0000 (13:10 +0000)]
FU r89545: change broke api watching by switching watch and unwatch around.
Also added zero to the article constructor..how many subtle bugs we need to make default article constructor sane?

13 years agoRevert r89925, setting disable_functions in php.ini is definitely the wrong way to...
Tim Starling [Tue, 14 Jun 2011 06:07:20 +0000 (06:07 +0000)]
Revert r89925, setting disable_functions in php.ini is definitely the wrong way to fix hash mismatches.

13 years agoMaintenance script for exporting the preprocessed wikitext from installer document...
Tim Starling [Tue, 14 Jun 2011 03:09:49 +0000 (03:09 +0000)]
Maintenance script for exporting the preprocessed wikitext from installer document pages, plus relevant refactoring. For use in updating mediawiki.org/wiki/Release_notes/1.17 etc.

13 years ago* Remove @static from the last few places it's left in core. Please don't use this...
Chad Horohoe [Tue, 14 Jun 2011 01:56:55 +0000 (01:56 +0000)]
* Remove @static from the last few places it's left in core. Please don't use this silly annotation anymore, that's what the static keyword is for.
* Enforce protected on SpecialAllPages::getNamespaceKeyAndText(), it's not @private like the comment implies
* Drop User::getMaxID(), nothing uses it

13 years agoFixing two broken tests in jquery.autoEllipsis.js for IE6 and Opera:
Krinkle [Tue, 14 Jun 2011 01:38:26 +0000 (01:38 +0000)]
Fixing two broken tests in jquery.autoEllipsis.js for IE6 and Opera:
* Mysterious test failure in IE6 in jquery.autoEllipsis.js finally figured. Way simpler than we thought. In IE6 width behaves like min-width, so adding one or two characters to a <span> with white-space:nowrap inside a <div> with a  fixed width will NOT (as other browsers do) make the span-width wider than the div-width, instead the div-width will happily increase as well.
* 2nd breakage fixed: In some cases adding 1 character did not widen the span, probably because of some edge case with narrow fonts and characters like "i" which are so small that they're just on the edge. Changed the test to add 2 characters instead of 1 to overcome this problem.

This new version of the test suite was already pushed to TestSwarm from my own account (instead of the MediaWiki-SVN account) and confirmed to work in IE6. Yay!

Not-pretty: Browser-sniffing for IE6 in a unit test..