lhc/web/wiklou.git
12 years agoFollowup r94995: add hooks.txt entries for the new hooks
Roan Kattouw [Fri, 19 Aug 2011 14:05:00 +0000 (14:05 +0000)]
Followup r94995: add hooks.txt entries for the new hooks

12 years agoReverse a bad decision in r93820, which added a comment to WebRequest::getFullRequest...
Roan Kattouw [Fri, 19 Aug 2011 13:25:43 +0000 (13:25 +0000)]
Reverse a bad decision in r93820, which added a comment to WebRequest::getFullRequestURL() saying it would return protocol-relative URLs if $wgServer is protocol-relative. This behavior makes no sense, though, and most callers expect fully qualified URLs. So make it return a fully qualified URL and update the one caller that expected the return value would be compatible with getFullURL()

12 years agoPer CR on r44412 and my promise in the commit summary of r94990, stop abusing $wgInte...
Roan Kattouw [Fri, 19 Aug 2011 11:23:17 +0000 (11:23 +0000)]
Per CR on r44412 and my promise in the commit summary of r94990, stop abusing $wgInternalServer (intended for Squid URLs) for IRC/e-mail URLs and introduce $wgCanonicalServer for these purposes instead. This revision introduces two new hooks for WMF hacks, in exchange for making the core code saner.

* Introduce $wgCanonicalServer, which should typically be a fully qualified version of $wgServer but in practice can be anything that you'd like to be used in IRC/e-mail notifs
** Default value is $wgServer, expanded to http:// if protocol-relative
** This means you can easily set HTTPS as the 'default' protocol to use in IRC and e-mail notifs by setting $wgCanonicalServer to https://example.com
* Introduce Title::getCanonicalURL(). Similar to getInternalURL(), including a hook for WMF usage (which will be needed as long as secure.wikimedia.org is used)
** Also add escapeCanonicalURL(). Due to some ridiculous accident of history, the other escapeFooURL() functions don't have a $variant parameter; I decided not to follow that bad example
* Reinstate the spirit of r44406 and r44412: instead of calling getInternalURL() (or getCanonicalURL()) and regexing the title parameter out, obtain the path to index.php using $wgCanonicalServer . $wgScript and append params to that. Sadly, we need to add a hook here to support the secure server hack for WMF, but that's the price of saner code in this case
* Introduce the {{canonicalurl:}} and {{canonicalurle:}} parser functions, which work just like {{fullurl:}} and {{fullurle:}} except that they use getCanonicalURL() instead of getFullURL()
* Use {{canonicalurl:}} in the enotif_body message, fixing bug 29993 (protocol-relative URLs appear in e-mail notifications)

12 years agoFu r94907 - also update localisation cache, which accesses the fallback variable...
Niklas Laxström [Fri, 19 Aug 2011 09:02:35 +0000 (09:02 +0000)]
Fu r94907 - also update localisation cache, which accesses the fallback variable directly
Fixes bug 30456

12 years agoFollowup r94754: move protocol expansion from getIRCLine() to inside getInternalUrl...
Roan Kattouw [Fri, 19 Aug 2011 08:56:39 +0000 (08:56 +0000)]
Followup r94754: move protocol expansion from getIRCLine() to inside getInternalUrl(); these internal URLs should always be fully qualified. Effectively this means that if $wgServer is protocol-relative and $wgInternalServer either isn't set or is also protocol relative (but it really shouldn't be the latter!), we'll add  to URLs used for Squid purging and in IRC lines. If people want those to be https:// instead, they can set $wgInternalServer accordingly.

We should really, really break the connection between internal URLs used for Squid purges and URLs used for IRC, and use the latter in e-mails as well. This was briefly discussed in the CR comments on r44412 and I'll be working on that today.

12 years ago* (bug 30450) Clear page_props table on page deletion
Sam Reed [Thu, 18 Aug 2011 23:37:04 +0000 (23:37 +0000)]
* (bug 30450) Clear page_props table on page deletion

Also clear them on a move over redirect

Modified delete() calls in doDeleteArticle to pass __METHOD__ for the function name

12 years agoTwo bugs:
Ian Baker [Thu, 18 Aug 2011 23:36:24 +0000 (23:36 +0000)]
Two bugs:
1. When the user isn't passed to UploadFromStash::__construct(), it would break when it shouldn't.
2. When stashing files, sometimes an instance of UnregisteredLocalFile would be returned instead of UploadStashFile

12 years ago* (bug 30451) Add page_props to RefreshLinks::deleteLinksFromNonexistent
Sam Reed [Thu, 18 Aug 2011 23:16:11 +0000 (23:16 +0000)]
* (bug 30451) Add page_props to RefreshLinks::deleteLinksFromNonexistent

12 years agoRemoved mention of AOL, no longer true since r39892
Alexandre Emsenhuber [Thu, 18 Aug 2011 21:04:29 +0000 (21:04 +0000)]
Removed mention of AOL, no longer true since r39892

12 years agoFix getRequet to getRequest
Sam Reed [Thu, 18 Aug 2011 20:56:57 +0000 (20:56 +0000)]
Fix getRequet to getRequest

12 years agoLocalisation updates for core and extension messages from translatewiki.net
Raimond Spekking [Thu, 18 Aug 2011 20:35:31 +0000 (20:35 +0000)]
Localisation updates for core and extension messages from translatewiki.net

12 years agoRemoved debugging code from r94932
Alexandre Emsenhuber [Thu, 18 Aug 2011 20:05:09 +0000 (20:05 +0000)]
Removed debugging code from r94932

12 years agoMoved wfGetIP() to WebRequest::getIP():
Alexandre Emsenhuber [Thu, 18 Aug 2011 20:03:30 +0000 (20:03 +0000)]
Moved wfGetIP() to WebRequest::getIP():
* Changed all calls in core to the latter
* Also marked wfGetForwardedFor() as deprecated
* Moved wfGetIP() tests to WebRequestTest

12 years ago* (bug 30217) Make pt-br a fallback of pt
Niklas Laxström [Thu, 18 Aug 2011 16:43:24 +0000 (16:43 +0000)]
* (bug 30217) Make pt-br a fallback of pt
Depends on r94907.

12 years agoAttempt to fix Bug 30216 - Improve language fallback loop detection.
Niklas Laxström [Thu, 18 Aug 2011 16:41:07 +0000 (16:41 +0000)]
Attempt to fix Bug 30216 - Improve language fallback loop detection.
Made fallbacks a list per language, instead of scanning them recursively through the languages.

12 years agoRelative values of the "Location" header are incorrect as stated in RFC, however...
Marooned [Thu, 18 Aug 2011 10:33:39 +0000 (10:33 +0000)]
Relative values of the "Location" header are incorrect as stated in RFC, however they do happen and modern browsers support them.
This function loops backwards through all locations in order to build the proper absolute URI - Marooned at wikia-inc.com

12 years agofu r94541: Delete empty files
Raimond Spekking [Thu, 18 Aug 2011 07:49:10 +0000 (07:49 +0000)]
fu r94541: Delete empty files

12 years agoMake testBug26425BlockTimestampDefaultsToTime be tolerrant of up to 2 seconds
Brian Wolff [Thu, 18 Aug 2011 06:23:44 +0000 (06:23 +0000)]
Make testBug26425BlockTimestampDefaultsToTime be tolerrant of up to 2 seconds
difference.

Otherwise if the test happens to be run on a second barrier, it could
falsely fail (like it did just now when codur said some hurtful things
about my code failing unit-tests where it really didn't ;)

Some of the other block tests seem to itermitantly fail for no appearent
reason (null comes back instead of the block)... I don't know why.

12 years agofollow-up r86169: unit tests for extraction of JPEG comment (COM) segments.
Brian Wolff [Thu, 18 Aug 2011 05:45:04 +0000 (05:45 +0000)]
follow-up r86169: unit tests for extraction of JPEG comment (COM) segments.

12 years agofollow-up r91885 rename testTiffFile since its not about tiff files
Brian Wolff [Thu, 18 Aug 2011 03:53:53 +0000 (03:53 +0000)]
follow-up r91885 rename testTiffFile since its not about tiff files

This is probably what was referred to in CR, not what I changed in r94825

12 years agoUpstreaming wikia change to WebRequest
Sam Reed [Thu, 18 Aug 2011 00:54:06 +0000 (00:54 +0000)]
Upstreaming wikia change to WebRequest

Trim trailing whitespace

Tweak documentation

12 years agoMove the image files used in the media tests from includes/media to data/media as...
Brian Wolff [Wed, 17 Aug 2011 23:28:31 +0000 (23:28 +0000)]
Move the image files used in the media tests from includes/media to data/media as the includes/media
was starting to get crowded with supporting image files.

This changes the following things
*Moves the media files to a different directory
*Changes the references to the files to reference there new locations

2 semi-unrelated changes
*Modify the README file that was basically giving credit for the images where due to explain what the images are for.
*set svn:mime-type to image/svg+xml for the svg files.

12 years agoRe-add release note accidentally removed in r94691.
Robin Pepermans [Wed, 17 Aug 2011 23:21:33 +0000 (23:21 +0000)]
Re-add release note accidentally removed in r94691.

12 years agoFollow-up r94836: move RELEASE-NOTES from 1.19 to 1.18.
Siebrand Mazeland [Wed, 17 Aug 2011 22:45:28 +0000 (22:45 +0000)]
Follow-up r94836: move RELEASE-NOTES from 1.19 to 1.18.

12 years agoMore wikia upstreaming
Sam Reed [Wed, 17 Aug 2011 22:42:49 +0000 (22:42 +0000)]
More wikia upstreaming

12 years agoStylize
Sam Reed [Wed, 17 Aug 2011 22:38:36 +0000 (22:38 +0000)]
Stylize

+upstream Wikia changes

12 years agoFollow-up r94690: correct language name for 'qug' to Kichwa. Kichwa or Northern Quech...
Robin Pepermans [Wed, 17 Aug 2011 22:35:52 +0000 (22:35 +0000)]
Follow-up r94690: correct language name for 'qug' to Kichwa. Kichwa or Northern Quechua covers several language codes including "qug", which is used as a temporary code until they got an official ISO 639 code or IETF tag.

12 years agoFollow-up r94690: set fallback to 'qu'.
Siebrand Mazeland [Wed, 17 Aug 2011 22:33:01 +0000 (22:33 +0000)]
Follow-up r94690: set fallback to 'qu'.

12 years agoUpstream another minor Wikia change
Sam Reed [Wed, 17 Aug 2011 22:28:08 +0000 (22:28 +0000)]
Upstream another minor Wikia change

12 years agoBased on diff to wikia, set more functions consistently public rather than protected
Sam Reed [Wed, 17 Aug 2011 22:24:21 +0000 (22:24 +0000)]
Based on diff to wikia, set more functions consistently public rather than protected

12 years agoMake the testCleanSig work no matter what $wgCleanSignatures; is in LocalSettings...
Brian Wolff [Wed, 17 Aug 2011 22:09:57 +0000 (22:09 +0000)]
Make the testCleanSig work no matter what $wgCleanSignatures; is in LocalSettings.php . Also have a test for when sig cleaning is disabled.

12 years agofollow-up r91885 - address CR comments
Brian Wolff [Wed, 17 Aug 2011 21:53:45 +0000 (21:53 +0000)]
follow-up r91885 - address CR comments

* rename testTiffFile to something more descriptive
* unserialize the serialized results before comparing
Also follow-up r92635 - rm an extra wfDl that was outside any functions, and I'm assuming accidentally there (?)

12 years agolistFiles() returns false when empty. Special:UplaodStash now deals with that correctly
Ian Baker [Wed, 17 Aug 2011 21:38:18 +0000 (21:38 +0000)]
listFiles() returns false when empty.  Special:UplaodStash now deals with that correctly
fixes bug 30429

12 years agoLocalisation updates for core and extension messages from translatewiki.net
Raimond Spekking [Wed, 17 Aug 2011 20:43:00 +0000 (20:43 +0000)]
Localisation updates for core and extension messages from translatewiki.net

12 years agomore test cases for highlighter; all pass the test of course
Thomas Gries [Wed, 17 Aug 2011 20:00:44 +0000 (20:00 +0000)]
more test cases for highlighter; all pass the test of course

12 years agoDocumentation
Sam Reed [Wed, 17 Aug 2011 17:11:49 +0000 (17:11 +0000)]
Documentation

Trim trailing whitespace

12 years agoFollowup r94421 which, per CR, broke in non-English content languages because of...
Roan Kattouw [Wed, 17 Aug 2011 14:55:06 +0000 (14:55 +0000)]
Followup r94421 which, per CR, broke in non-English content languages because of key mismatches due to localized namespace names. Now ensuring all titles go through getPrefixedDBkey() before we compare them, so they're always normalized. This also ensures we don't get underscore vs. space confusion, which is something that the previous code did right by accident.

12 years agoFollowup r80248; Fix inverted message exists tests in ProtectionForm.
Daniel Friesen [Wed, 17 Aug 2011 14:10:41 +0000 (14:10 +0000)]
Followup r80248; Fix inverted message exists tests in ProtectionForm.

12 years ago(bug 30398) Expand any protocol-relative URLs to HTTP in RecentChange::getIRCLine...
Roan Kattouw [Wed, 17 Aug 2011 13:32:45 +0000 (13:32 +0000)]
(bug 30398) Expand any protocol-relative URLs to HTTP in RecentChange::getIRCLine(). This will prevent sending protocol-relative URLs to the IRC feed

12 years agoSelf-revert r79892: only got one opposition and apparently too hairy for anyone else...
Niklas Laxström [Wed, 17 Aug 2011 09:55:09 +0000 (09:55 +0000)]
Self-revert r79892: only got one opposition and apparently too hairy for anyone else to comment :)

12 years agoAmend the documention of search profile, fu r86714
Niklas Laxström [Wed, 17 Aug 2011 09:50:54 +0000 (09:50 +0000)]
Amend the documention of search profile, fu r86714

12 years agofollow-up r94601 - add unit tests for stripping the File: prefix from upload, and...
Brian Wolff [Wed, 17 Aug 2011 04:05:11 +0000 (04:05 +0000)]
follow-up r94601 - add unit tests for stripping the File: prefix from upload, and test handling illegal characters in upload title (thing that caused the issue in r94601)

(I have no idea if things like this (unit-tests) should be tagged 1.18, I assume no but am unsure)

12 years agoFollow-up r94680 - fix unit tests.
Brian Wolff [Wed, 17 Aug 2011 00:46:58 +0000 (00:46 +0000)]
Follow-up r94680 - fix unit tests.

The way the magic variable unit tests are run looks a little sketchy to me...

12 years agoFix some bad "Implements Special:*" comments in includes/specials/ files.
Daniel Friesen [Wed, 17 Aug 2011 00:41:17 +0000 (00:41 +0000)]
Fix some bad "Implements Special:*" comments in includes/specials/ files.

12 years agoLocalisation updates from http://translatewiki.net.
Siebrand Mazeland [Wed, 17 Aug 2011 00:08:51 +0000 (00:08 +0000)]
Localisation updates from translatewiki.net.

Full rebuild of file.

12 years agoFix a regression in search highlighting from r90092
Brion Vibber [Tue, 16 Aug 2011 22:42:57 +0000 (22:42 +0000)]
Fix a regression in search highlighting from r90092

Followup on r94609, r94681 test cases.
This fixes the test case with a period that was failing; problem was not the period, but the space before.
The changed regex in r90092 ended up including the preceding whitespace in the match, so the position of the match was coming up one character before the actual word -- thus offsetting the highlight by one char.

Changed from search to match, using the regex's index property (same as search returns) and adding in the length of the first match component which covers the space/whatever

12 years agoBreak lines at or before 80 and update punctuation.
Siebrand Mazeland [Tue, 16 Aug 2011 21:30:23 +0000 (21:30 +0000)]
Break lines at or before 80 and update punctuation.

12 years agoAdd new language Chimborazo Highland Quichua (qug).
Siebrand Mazeland [Tue, 16 Aug 2011 21:29:39 +0000 (21:29 +0000)]
Add new language Chimborazo Highland Quichua (qug).

12 years agoLocalisation updates from http://translatewiki.net.
Siebrand Mazeland [Tue, 16 Aug 2011 20:54:19 +0000 (20:54 +0000)]
Localisation updates from translatewiki.net.

12 years agoFollowup r94609: fix jquery.highlightText test cases on IE, simplify test case setup...
Brion Vibber [Tue, 16 Aug 2011 19:34:47 +0000 (19:34 +0000)]
Followup r94609: fix jquery.highlightText test cases on IE, simplify test case setup so new ones can be added more trivially, uncommented the failing test case.

These tests were failing on IE 6, 7, and 8 because the innerHTML rendering of the highlighted text came out in caps and without quotes, such that the string didn't match the provided one. By re-normalizing the expected HTML form this check now works on those browsers. Switching common code to a loop and an array makes it easier to add new test cases: less duplication of code, and no need to manually update the number of test cases.

Note that the third test case was previously commented out, but looks like a serious regression. No longer commented out, so this will fail!

12 years agoMagic words (time and number-formatting ones, plus DIRECTIONMARK, but not NAMESPACE...
Robin Pepermans [Tue, 16 Aug 2011 19:29:52 +0000 (19:29 +0000)]
Magic words (time and number-formatting ones, plus DIRECTIONMARK, but not NAMESPACE) now depend on the page content language instead of the site language. In theory this sets the right magic words in system messages, although they are not used there.
Useful for multilingual wikis like Incubator, and probably for extensions like Translate.

12 years agoFollowup r94678: remove some include and autoload entries. tests still passing
Chad Horohoe [Tue, 16 Aug 2011 19:25:26 +0000 (19:25 +0000)]
Followup r94678: remove some include and autoload entries. tests still passing

12 years agoRemove ParserHelpers. NewParserTest still needs some cleanup, but it doesn't rely...
Chad Horohoe [Tue, 16 Aug 2011 19:18:07 +0000 (19:18 +0000)]
Remove ParserHelpers. NewParserTest still needs some cleanup, but it doesn't rely on this. All tests still pass.

12 years agodifferent wording from r83554.
Antoine Musso [Tue, 16 Aug 2011 19:07:10 +0000 (19:07 +0000)]
different wording from r83554.

12 years agoenable colors in PHPUnit (redoing r89179).
Antoine Musso [Tue, 16 Aug 2011 18:23:13 +0000 (18:23 +0000)]
enable colors in PHPUnit (redoing r89179).

suite.xml now comes with colors=true. Under Windows, we override the
setting by forging a --no-colors. One can still force color usage
under windows by using --colors.

12 years agoCleaning up little things, updates to code clarity, documentation fixes per Catrope...
Ian Baker [Tue, 16 Aug 2011 17:57:32 +0000 (17:57 +0000)]
Cleaning up little things, updates to code clarity, documentation fixes per Catrope's suggestions.
followup to r94536, r94592, r94594

12 years agow/s changes
Mark A. Hershberger [Tue, 16 Aug 2011 16:03:29 +0000 (16:03 +0000)]
w/s changes

12 years agoFix some indentation and comments in mediawiki.Title, and make it depend on mediawiki...
Roan Kattouw [Tue, 16 Aug 2011 15:32:08 +0000 (15:32 +0000)]
Fix some indentation and comments in mediawiki.Title, and make it depend on mediawiki.util

12 years agoSome misc fixes to tests:
Alexandre Emsenhuber [Tue, 16 Aug 2011 15:17:35 +0000 (15:17 +0000)]
Some misc fixes to tests:
* Don't create a WebRequest instance to put in $wgRequest in test since it is meant for HTTP requests, not command line ones
* Force $wgAlwaysUseTidy to false in ExtraParserTest, having it to true breaks testBug8689() and testParse()

12 years agoTests for wfGetIP() follow up r89407
Antoine Musso [Tue, 16 Aug 2011 14:15:07 +0000 (14:15 +0000)]
Tests for wfGetIP() follow up r89407

* wfGetIP() now support resetting its internal static variable. Thanks to
Platonides which introduced this trick with r92960.
* Various tests for $_SERVER['REMOTE_ADDR'] and $wgCommandLineMode.

revert r94575:
 - reenable testGetFromServerRemoteAddr() which was not an issue

reintroduce r94558:
 - per CR on r94558 by Aaron use meaningful parameter to wfGetIP() when
   resetting the static variable ( 'reset' instead of true).
 - keep testLackOfRemoteAddrThrowAnException() test in the broken group
   with a comment for later fixing.

TODO:

- implements tests for XFF headers.

TEST PLAN:

$ ./phpunit.php --filter wfGetIP --testdox
PHPUnit 3.5.14 by Sebastian Bergmann.

wfGetIP
[x] Get loopback address when in command line
[x] Get from server remote addr
[x] Lack of remote addr throw an exception
$

12 years agoFollowup r89853, tweaks for jquery.qunit.completenessTest:
Roan Kattouw [Tue, 16 Aug 2011 13:33:22 +0000 (13:33 +0000)]
Followup r89853, tweaks for jquery.qunit.completenessTest:
* Don't assume $ as a global, but alias it to jQuery instead. The code is already wrapped in a closure so this is easy
* Remove unused constants TYPE_SIMPLEFUNC and TYPE_OBJCONSTRFUNC
* Fix spelling in comments, mostly brake->break
* Fix whitespace
* Kill useless return at the end of a void function
* Correct comment in hasTests() which claims the function does the opposite of what it really does

12 years agoFollowup r89545: add ,0 to Article constructor call
Roan Kattouw [Tue, 16 Aug 2011 12:48:05 +0000 (12:48 +0000)]
Followup r89545: add ,0 to Article constructor call

12 years agoFollowup r90041: keep naming of watch and unwatch calls consistent
Roan Kattouw [Tue, 16 Aug 2011 12:46:15 +0000 (12:46 +0000)]
Followup r90041: keep naming of watch and unwatch calls consistent

12 years agoPer Reedy, follow-up r93758: SpecialPage::capturePath() now has incorrect signature...
Alexandre Emsenhuber [Tue, 16 Aug 2011 11:05:19 +0000 (11:05 +0000)]
Per Reedy, follow-up r93758: SpecialPage::capturePath() now has incorrect signature. Removed the function rather than updating it, since it's not called at all and current behavior is incompatible with the old one.

12 years agocorrect number of tests fu r94609
Antoine Musso [Tue, 16 Aug 2011 10:29:29 +0000 (10:29 +0000)]
correct number of tests fu r94609

12 years agoforce QUnit charset to UTF-8
Antoine Musso [Tue, 16 Aug 2011 10:28:05 +0000 (10:28 +0000)]
force QUnit charset to UTF-8

12 years agotests for jquery.highlightText
Antoine Musso [Tue, 16 Aug 2011 08:04:34 +0000 (08:04 +0000)]
tests for jquery.highlightText

In r90092, wikinaut requested tests for our highlightText jQuery plugin.
Here is a basic framework than almost anyone can enhance :-)

12 years agofollow-up r88171 - fix fatal if suggested filename has illegal character in it.
Brian Wolff [Tue, 16 Aug 2011 05:37:18 +0000 (05:37 +0000)]
follow-up r88171 - fix fatal if suggested filename has illegal character in it.

Check to make sure the title object actual exists, before checking its namespace,
since alll the does this have illegal chars check is done after the does it
start with file: check.

For future note though, when using upload by url feature, the suggested
destination name when you put http://upload.wikimedia.org/wikipedia/commons/e/e0/Petrorhagia_prolifera_%281%29.JPG is illegal, which is probably not very user-friendly (filed as bug 30390)

12 years agoExplicitally define some member variables
Sam Reed [Tue, 16 Aug 2011 00:41:50 +0000 (00:41 +0000)]
Explicitally define some member variables

Fix/update/add to comments

Add some braces

12 years agoRemoved the ability to pass a key into stashFile(), which simplifies the stash row...
Ian Baker [Mon, 15 Aug 2011 23:58:40 +0000 (23:58 +0000)]
Removed the ability to pass a key into stashFile(), which simplifies the stash row creation a great deal.
Updated UploadFromUrlJob to properly use the database stash
followup to r92200

12 years agoRemoved complex replag handling, now just query master when record isn't present...
Ian Baker [Mon, 15 Aug 2011 23:40:57 +0000 (23:40 +0000)]
Removed complex replag handling, now just query master when record isn't present on slave.
followup to r92009

12 years agoback off r94558:
Antoine Musso [Mon, 15 Aug 2011 21:45:18 +0000 (21:45 +0000)]
back off r94558:
 - reverts ./includes/ProxyTools.php
 - marks tests broken

In our test suite, the first call to wfGetIP() set the static variable.
Hence the remaining of the code is only tested on the first call to it.
Resetting the static variable enlight a bug somewhere in our code where
we are calling wfGetIP() but can not reliably get an IP, somehow REMOTE_ADDR
does not exist and $wgCommandLineMode is disabled.
Will have to track this bug further when I got time.

12 years agoavoid playing with $_SERVER in test for now
Antoine Musso [Mon, 15 Aug 2011 21:18:23 +0000 (21:18 +0000)]
avoid playing with $_SERVER in test for now

fu r94558

12 years agoRevert r94041: PHP Notice: Undefined index: SERVER_PROTOCOL in /home/ci/cruisecontrol...
Brion Vibber [Mon, 15 Aug 2011 21:04:11 +0000 (21:04 +0000)]
Revert r94041: PHP Notice: Undefined index: SERVER_PROTOCOL in /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Exception.php on line 185

This code appears to be trying to output something like 'HTTP/1.1 500 MediaWiki Error', but using $_SERVER['SERVER_PROTOCOL']. And it seems to output it on things that run in phpunit tests.
Seems pretty broken?

12 years agoTests for wfGetIP() follow up r89407
Antoine Musso [Mon, 15 Aug 2011 20:16:15 +0000 (20:16 +0000)]
Tests for wfGetIP() follow up r89407

* wfGetIP() now support resetting its internal static variable. Thanks to
 Platonides which introduced this trick with r92960.
* Various tests for $_SERVER['REMOTE_ADDR'] and $wgCommandLineMode.

TODO:

- implements tests for XFF headers.

TEST PLAN:

$ ./phpunit.php --filter wfGetIP --testdox
PHPUnit 3.5.14 by Sebastian Bergmann.

wfGetIP
 [x] Get loopback address when in command line
 [x] Get from server remote addr
 [x] Lack of remote addr throw an exception
$

12 years agoPHPUnit test file must end with 'Test.php'
Antoine Musso [Mon, 15 Aug 2011 19:39:55 +0000 (19:39 +0000)]
PHPUnit test file must end with 'Test.php'

follow up r92045

12 years agoFollowup r92430 per CR, like r94448
Sam Reed [Mon, 15 Aug 2011 18:56:37 +0000 (18:56 +0000)]
Followup r92430 per CR, like r94448

12 years agoFollowup r94541 (reverts of r94289 undiscussed core schema change and followups)...
Brion Vibber [Mon, 15 Aug 2011 18:52:33 +0000 (18:52 +0000)]
Followup r94541 (reverts of r94289 undiscussed core schema change and followups), two more that got missed: reverts of r94290, r94364

12 years agoRestored r94370 changes PopulateRevisionLen, moving it to $postDatabaseUpdateMaintenance
Aaron Schulz [Mon, 15 Aug 2011 18:52:25 +0000 (18:52 +0000)]
Restored r94370 changes PopulateRevisionLen, moving it to $postDatabaseUpdateMaintenance

12 years agoPartial revert to r87584
Sam Reed [Mon, 15 Aug 2011 18:35:19 +0000 (18:35 +0000)]
Partial revert to r87584

To fix bug bug 30355 importImages.php Internal Error

12 years agoRevert r94289, r94290, r94294, r94333, r94345, r94362, r94370 -- core schema change...
Brion Vibber [Mon, 15 Aug 2011 18:24:38 +0000 (18:24 +0000)]
Revert r94289, r94290, r94294, r94333, r94345, r94362, r94370 -- core schema change with no discussion

12 years agochecking for existence of mLocalFile in stashFile() was inverted
Ian Baker [Mon, 15 Aug 2011 18:19:54 +0000 (18:19 +0000)]
checking for existence of mLocalFile in stashFile() was inverted
followup to r94536

12 years agocleaned up database query, doesn't have to be aware of column names anymore (thanks...
Ian Baker [Mon, 15 Aug 2011 18:17:51 +0000 (18:17 +0000)]
cleaned up database query, doesn't have to be aware of column names anymore (thanks Catrope!)
followup to r92009

12 years agoFixed incorrect usage of || operator, added test
Ian Baker [Mon, 15 Aug 2011 18:10:10 +0000 (18:10 +0000)]
Fixed incorrect usage of || operator, added test
removed spurious use of empty()
listFiles() was broken, now works
followup to r92009

12 years agoFix up NS_MAIN subpage tests
Antoine Musso [Mon, 15 Aug 2011 14:17:45 +0000 (14:17 +0000)]
Fix up NS_MAIN subpage tests

Per CR on r92234, this correctly test hasSubpages independently from your
local configuration.  Also test altering the global and having static
methods reacting accordingly.

12 years agoFollowup r94502: per CR, use two caching variables instead of an array indexed with...
Roan Kattouw [Mon, 15 Aug 2011 13:16:10 +0000 (13:16 +0000)]
Followup r94502: per CR, use two caching variables instead of an array indexed with true or false

12 years agoAdd parser test for r94502
Roan Kattouw [Mon, 15 Aug 2011 12:25:01 +0000 (12:25 +0000)]
Add parser test for r94502

12 years ago(bug 30269) Strings like foobar//barfoo are linked to become foobar[//barfoo]
Roan Kattouw [Mon, 15 Aug 2011 12:20:00 +0000 (12:20 +0000)]
(bug 30269) Strings like foobar//barfoo are linked to become foobar[//barfoo]

* Introduce a boolean parameter to wfUrlProtocols() which, if set to false, will cause '//' to be dropped from the returned regex so it doesn't match protocol-relative URLs
* Introduce wfUrlProtocolsWithoutProtRel() as a wrapper for wfUrlProtocols( false ). The latter should not be used directly because the former is much clearer
* Use this new function in Parser::doMagicLinks() to fix the original bug. Also use it in ApiFormatBase::formatHTML() and CodeCommentLinker::link(), which probably had similar bugs

12 years agoLocalization update for he.
Rotem Liss [Mon, 15 Aug 2011 10:31:23 +0000 (10:31 +0000)]
Localization update for he.

12 years agoFix space/tab indentation FU r94444
Antoine Musso [Mon, 15 Aug 2011 10:23:48 +0000 (10:23 +0000)]
Fix space/tab indentation FU r94444

12 years ago* Revert r94487 and r19889 to an extent -- ONLY check for the X-Forwarded-For header...
Ryan Schmidt [Mon, 15 Aug 2011 05:25:56 +0000 (05:25 +0000)]
* Revert r94487 and r19889 to an extent -- ONLY check for the X-Forwarded-For header when we are behind a proxy, as mostly every properly configured proxy software sets it, and attempting to support those that do not opens up the ability to spoof IP addresses by setting arbitrary headers.

12 years ago* Follow-up r92673: add documentation on how to use $wgDnsBlacklistUrls to DefaultSet...
Ryan Schmidt [Mon, 15 Aug 2011 05:12:56 +0000 (05:12 +0000)]
* Follow-up r92673: add documentation on how to use $wgDnsBlacklistUrls to DefaultSettings (lifted from the Manual page on mediawiki.org)

12 years agoWhen MediaWiki is being run behind a proxy, also check the X-Real-IP header to determ...
Ryan Schmidt [Mon, 15 Aug 2011 04:50:51 +0000 (04:50 +0000)]
When MediaWiki is being run behind a proxy, also check the X-Real-IP header to determine the client's actual IP address (some servers such as nginx might set this instead of X-Forwarded-For depending on configuration).

12 years ago* Follow-up to r91284: fix error in Action::exists by passing empty array as required...
Ryan Schmidt [Mon, 15 Aug 2011 04:02:08 +0000 (04:02 +0000)]
* Follow-up to r91284: fix error in Action::exists by passing empty array as required second parameter to Action::getClass

12 years agoAdded Parser::recursivePreprocess(); like preprocess() but doesn't call startParse...
Alexandre Emsenhuber [Sun, 14 Aug 2011 20:22:52 +0000 (20:22 +0000)]
Added Parser::recursivePreprocess(); like preprocess() but doesn't call startParse() so that it can be used inside a parse operation using the same context without having to mess with other functions

Simple use case (PHP 5.3+) that will work show the expand text passed to a <preprocess> tag:
$wgHooks['ParserFirstCallInit'][] = function( $parser ) {
$parser->setHook( 'preprocess', function( $text, $attr, $parser, $frame ) {
return $parser->recursivePreprocess( $text, $frame );
} );
return true;
};

12 years agoUse local context instead of global variables
Alexandre Emsenhuber [Sun, 14 Aug 2011 19:54:04 +0000 (19:54 +0000)]
Use local context instead of global variables

12 years agoFix fail from r94473
Sam Reed [Sun, 14 Aug 2011 19:50:08 +0000 (19:50 +0000)]
Fix fail from r94473

Append to the string, don't replace it

12 years agoAdd/update documentation
Sam Reed [Sun, 14 Aug 2011 19:49:07 +0000 (19:49 +0000)]
Add/update documentation

12 years agoMade Xml::buildTable() wrap header stuff in <thead></thead>
Sam Reed [Sun, 14 Aug 2011 19:47:44 +0000 (19:47 +0000)]
Made Xml::buildTable() wrap header stuff in <thead></thead>

12 years agoAdd code to the sanitizer to convert presontational attributes that were removed...
Daniel Friesen [Sun, 14 Aug 2011 16:41:53 +0000 (16:41 +0000)]
Add code to the sanitizer to convert presontational attributes that were removed in html5 into inline css. This allows wiki to keep using them in short loose WikiText but still output valid modern markup.
Note that there were some attributes excluded. Namely stuff on img and object, and the table cellspacing and cellpading which aren't easily converted into inline css.