lhc/web/wiklou.git
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.

12 years agoThis Sanitizer::EVIL_URI_PATTERN is completely inadequate for actual security as...
Daniel Friesen [Sun, 14 Aug 2011 14:59:26 +0000 (14:59 +0000)]
This Sanitizer::EVIL_URI_PATTERN is completely inadequate for actual security as there are numerious ways to bypass blacklisting.
Since it's only used right now for paranoia in cases you currently can't actually exploit a browser we let it slide.
However this thing needs a big fat warning message next to it to avoid someone thinking this is actually a good idea for security and ending up later on using it and opening up an XSS hole in core.

12 years agoFix r94429 : Left and right side are still nearly the same color for 7% of the popula...
Leo Koppelkamm [Sun, 14 Aug 2011 14:40:56 +0000 (14:40 +0000)]
Fix r94429 : Left and right side are still nearly the same color for 7% of the population. When I wrote to the list a while ago, no one argued for keeping the yellow scheme just because we're used to it. This makes it red/blue, also increases the highlight area ands adds a subtle border per Brandon Harris

12 years agoFollowup r94353; Use !== null since that's what we use in core.
Daniel Friesen [Sun, 14 Aug 2011 14:20:59 +0000 (14:20 +0000)]
Followup r94353; Use !== null since that's what we use in core.

12 years agoFollowup r94375; Use PROTO_RELATIVE so that when $wgServer is a protocol relative...
Daniel Friesen [Sun, 14 Aug 2011 14:07:12 +0000 (14:07 +0000)]
Followup r94375; Use PROTO_RELATIVE so that when $wgServer is a protocol relative url we don't potentially polute the cache if getFullURL is called by an extension that outputs to cache. getFullURL includes a #fragment so it's more likely that extensions outputting urls in situations that don't support protocol relative urls are using getLocalURL and expanding it.

12 years agoFollowup to r92580 and r93820: r92580 duplicated the call to wfExpandUrl(), and r9382...
Roan Kattouw [Sun, 14 Aug 2011 13:35:06 +0000 (13:35 +0000)]
Followup to r92580 and r93820: r92580 duplicated the call to wfExpandUrl(), and r93820 caused them to get out of sync.

12 years agoApiParamInfo: if no help URLs are available, return an empty array instead of array...
Max Semenik [Sun, 14 Aug 2011 09:37:23 +0000 (09:37 +0000)]
ApiParamInfo: if no help URLs are available, return an empty array instead of array with one empty element

12 years agoApiOpenSearch: make description a verb, just like the other modules
Max Semenik [Sun, 14 Aug 2011 09:19:54 +0000 (09:19 +0000)]
ApiOpenSearch: make description a verb, just like the other modules

12 years ago(bug 28273) Merge purgeList and purgeNamespace scripts
Antoine Musso [Sun, 14 Aug 2011 08:51:36 +0000 (08:51 +0000)]
(bug 28273) Merge purgeList and purgeNamespace scripts

Nothing fancy, just copy pasted from purgeNamespace into purgeList.
This need to be in 1.18 to avoid publishing purgeNamespace to everyone
and removing it in 1.19 =)

12 years agoAllow extensions to run their own backlink-based updates:
Victor Vasiliev [Sat, 13 Aug 2011 22:42:09 +0000 (22:42 +0000)]
Allow extensions to run their own backlink-based updates:
* Introduce new hooks which allow BacklinkCache to handle non-core tables
* Make table name a parameter to RefreshLinks2 job (instead of hardcoded templatelinks)

12 years ago(bug 26486) ResourceLoader modules with paths to nonexistent files cause PHP warnings...
Roan Kattouw [Sat, 13 Aug 2011 21:25:02 +0000 (21:25 +0000)]
(bug 26486) ResourceLoader modules with paths to nonexistent files cause PHP warnings/notices to be thrown. Worked around all of them using file_exists() checks, and introduced a safe wrapper around filemtime() that checks for file_exists(). The only warning I couldn't squash is "Warning: array_map(): An error occurred while invoking the map callback" but that's due to a bug in PHP, which I've reported at https://bugs.php.net/bug.php?id=55416

12 years agoBumped $wgCookieExpiration to 180 days, we were one of the sites with shortest cookie...
Max Semenik [Sat, 13 Aug 2011 21:13:14 +0000 (21:13 +0000)]
Bumped $wgCookieExpiration to 180 days, we were one of the sites with shortest cookie lifetime for too long. This was discussed at lengths about a year ago on wikitech-l, however nobody cared to implement the suggested alternative solutions. Probably because they were overcomplicated and solved only parts of the problem.

12 years ago(bug 11374) Red .diffchange text in the green 'added' area may be hard to read for...
Max Semenik [Sat, 13 Aug 2011 20:57:24 +0000 (20:57 +0000)]
(bug 11374) Red .diffchange text in the green 'added' area may be hard to read for colorblind users
This should REALLY REALLY be fixed with colors from French Wikipedia, but since some people think that we should preserve yellow/green colors, I've simply made change text black instead of red, and made its background different for better reading by people with other problems with vision.

12 years agoMove wfStreamFile() into a class, update all callers in core (only 3 extensions use...
Chad Horohoe [Sat, 13 Aug 2011 19:03:51 +0000 (19:03 +0000)]
Move wfStreamFile() into a class, update all callers in core (only 3 extensions use it afaict), leave wfStreamFile() as a b/c alias for now.
Yay less global functions, autoloading and less manual require()s.

12 years agoAdd RELEASE-NOTES for r93744
Roan Kattouw [Sat, 13 Aug 2011 19:02:45 +0000 (19:02 +0000)]
Add RELEASE-NOTES for r93744

12 years agoAdd RELEASE-NOTES for r93818 and r94155. Adding to the 1.18 file since they're tagged...
Roan Kattouw [Sat, 13 Aug 2011 18:33:00 +0000 (18:33 +0000)]
Add RELEASE-NOTES for r93818 and r94155. Adding to the 1.18 file since they're tagged for 1.18

12 years agoLocalisation update for core and extension messages from translatewiki.net (2011...
Raimond Spekking [Sat, 13 Aug 2011 18:19:15 +0000 (18:19 +0000)]
Localisation update for core and extension messages from translatewiki.net (2011-08-13 18:00:00)

12 years agoRemove mention of wfOut() in comment
Alexandre Emsenhuber [Sat, 13 Aug 2011 18:12:43 +0000 (18:12 +0000)]
Remove mention of wfOut() in comment

12 years agoAdd a RELEASE-NOTES note about protocol-relative URLs to the 1.18 RELEASE-NOTES....
Roan Kattouw [Sat, 13 Aug 2011 17:35:28 +0000 (17:35 +0000)]
Add a RELEASE-NOTES note about protocol-relative URLs to the 1.18 RELEASE-NOTES. Support for protocol-relative URLs is almost-there-but-not-quite at this point, so this is a little bit preliminary, but we will deploy this on WMF soon and merge all fixes to 1.18, so I figured it's better to put this in now before I forget.

12 years ago(bug 26283) Previewing user JS/CSS pages doesn't load other user JS/CSS pages
Roan Kattouw [Sat, 13 Aug 2011 17:27:35 +0000 (17:27 +0000)]
(bug 26283) Previewing user JS/CSS pages doesn't load other user JS/CSS pages

12 years ago* (bug 26885) Allow show/hide of account blocks, temporary blocks and single IP block...
Sam Reed [Sat, 13 Aug 2011 15:39:57 +0000 (15:39 +0000)]
* (bug 26885) Allow show/hide of account blocks, temporary blocks and single IP blocks for list=blocks

Patch by John DuHart

Minor extras:
* Minor style tweak
* Add new error to getPossibleErrors
* Reused $p for module prefix

12 years agoUse local context instead of global variables
Alexandre Emsenhuber [Sat, 13 Aug 2011 14:53:23 +0000 (14:53 +0000)]
Use local context instead of global variables

12 years agoRm debugging hack from r94029.
Max Semenik [Sat, 13 Aug 2011 14:24:24 +0000 (14:24 +0000)]
Rm debugging hack from r94029.

12 years agorvv (r94406)
Chad Horohoe [Sat, 13 Aug 2011 14:00:22 +0000 (14:00 +0000)]
rvv (r94406)

12 years agoPurposefully break two tests so I can see how Jenkins reacts to it. Will rv immediately
Chad Horohoe [Sat, 13 Aug 2011 13:58:46 +0000 (13:58 +0000)]
Purposefully break two tests so I can see how Jenkins reacts to it. Will rv immediately

12 years agoRemove bogus comments from OutputPage::makeResourceLoaderLink(). They made sense...
Roan Kattouw [Sat, 13 Aug 2011 08:42:13 +0000 (08:42 +0000)]
Remove bogus comments from OutputPage::makeResourceLoaderLink(). They made sense once, but they don't any more

12 years agoMark wfMsgWikiHtml() as an interface message so it doesn't get converted according...
Robin Pepermans [Fri, 12 Aug 2011 23:14:32 +0000 (23:14 +0000)]
Mark wfMsgWikiHtml() as an interface message so it doesn't get converted according to the content language (see also r94279)

12 years agoReverting r90613 and the like, no need to set global variables (at least not anymore).
Krinkle [Fri, 12 Aug 2011 22:59:49 +0000 (22:59 +0000)]
Reverting r90613 and the like, no need to set global variables (at least not anymore).

12 years agoApplying whitespace conventions in core JS files.
Krinkle [Fri, 12 Aug 2011 21:48:10 +0000 (21:48 +0000)]
Applying whitespace conventions in core JS files.
* Mostly whitespace in callers: $('foo').bar(baz,quux) => $( 'foo' ).bar( baz, quux )
* Also several occurrences of mixes spaces and tabs in the indention in front of a line, converted to tabs.
* And double spaces -> single spaces at random.

12 years agoUse .prop instead of .attr where appropriate
Krinkle [Fri, 12 Aug 2011 21:19:45 +0000 (21:19 +0000)]
Use .prop instead of .attr where appropriate

* Although jQuery covers for us in most cases (since .prop didn't exist before jQuery 1.6 and many people abused .attr in laziness of doing their own loop and setting the property manually). It's better to know what we're doing and call the function we intend to call. Both because jQuery may decide to stop rerouting common mistakes to .prop and because it makes code more readable.

* Aside from switching to prop, for boolean properties also replacing null/undefined with false and 'propname' with true. This is no longer being covered by jQuery when using prop directly (as it shouldn't). When an element is created the HTML specification says that the attribute should be set to it's name (ie. '<foo selected="selected">'), the properties however must remain boolean.

* Changing the attribute value for a boolean property (ie. checkbox.setAttribute( 'checked', 'checked' ) does not make the checkbox enabled. All it does is set the attribute. The reason this works with jQuery's attr() is because jQuery calls .prop internally after a bunch of checking inside attr().

-- Reference --
The list of keys that .attr and .removeAttr jQuery is currently (as of jQuery 1.6.1) remapping to use .prop and .removeProp can be found here:
https://github.com/jquery/jquery/blob/b22c9046529852c7ce567df13397849e11e2b9cc/src/attributes.js#L425
{
tabindex: "tabIndex",
readonly: "readOnly",
"for": "htmlFor",
"class": "className",
maxlength: "maxLength",
cellspacing: "cellSpacing",
cellpadding: "cellPadding",
rowspan: "rowSpan",
colspan: "colSpan",
usemap: "useMap",
frameborder: "frameBorder",
contenteditable: "contentEditable"
}
In addition to those, jQuery also maps these boolean properties to .prop when they are passed to .attr:
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,

(source: https://github.com/jquery/jquery/blob/b22c9046529852c7ce567df13397849e11e2b9cc/src/attributes.js#L9 )

12 years agoUpdate the Html5 void elements and boolean attributes, in accordance with the latest...
Derk-Jan Hartman [Fri, 12 Aug 2011 21:04:25 +0000 (21:04 +0000)]
Update the Html5 void elements and boolean attributes, in accordance with the latest draft.

12 years agoChanged PopulateImageSha1 to use LoggedUpdateMaintenance and added it to $postDatabas...
Aaron Schulz [Fri, 12 Aug 2011 20:37:35 +0000 (20:37 +0000)]
Changed PopulateImageSha1 to use LoggedUpdateMaintenance and added it to $postDatabaseUpdateMaintenance

12 years agoFix bug in jquery.byteLimit.js for Safari 4
Krinkle [Fri, 12 Aug 2011 20:34:23 +0000 (20:34 +0000)]
Fix bug in jquery.byteLimit.js for Safari 4
* Browsers should ignore the maxLength when the .value is set manually through JavaScript, but for some reason Safari 4 (not 5 and later) is enforcing the limit even when the value property is set from JavaScript. Usually this bug doesn't become visible in this module because the byteLength can't be lower than the number of characters, so we'd never see the bug. However since r94066 we're supporting callbacks, and callbacks could do anything to the calculation, including but not limited to making the string that is being checked shorter (ie. suppose maxLength/byteLimit is 8, value is 'User:Sam', and callback filters like "return new mw.Title(val).getName()". If we set it to 'User:Samp' (+p) then Safari 4 would chop the value, because the total string is longer than 8. Whereas all other browsers ignore maxLength (like they should) and let it be and would allow our callback to happen and instead give byteLimit 'Samp' which is length 4 and we still have 4 more characters to go until we reach 8.

The fix is easy, simply do not set the maxLength property if there's a callback.

12 years agoTouch up Title::get[Full|Local]URL. This concept of "if not an existing interwiki...
Daniel Friesen [Fri, 12 Aug 2011 19:55:03 +0000 (19:55 +0000)]
Touch up Title::get[Full|Local]URL. This concept of "if not an existing interwiki getFullURL calls getLocalURL" and "if external (interwiki) getLocalURL calls getFullURL" is ridiculous. In fact if mInterwiki just happens to not be '' and not exist, you create infinite recursion and php dies.
Instead of having getFullURL and getLocalURL call each other, move the interwiki workload into getLocalURL, and make getFullURL simply call getLocalURL then expand it (use the wf method in case it's already a full url) and append the fragment to it.

12 years agoMore to r94370:
Aaron Schulz [Fri, 12 Aug 2011 19:24:08 +0000 (19:24 +0000)]
More to r94370:
* Fixed hard-coded output message (use $table)
* Removed doPopulateRevSha1 from SqliteUpdater.php too (didn't notice someone added this)

12 years agoImprove the ability for extensions to participate in how MediaWiki handles url paths:
Daniel Friesen [Fri, 12 Aug 2011 19:23:43 +0000 (19:23 +0000)]
Improve the ability for extensions to participate in how MediaWiki handles url paths:
- Allow extensions to hook into WebRequest::getPathInfo and add to or alter the way titles are extracted from paths
- Add a $variant argument to the GetLocalURL hook; It's always had $query, but never had $variant. As a result extensions using GetLocalURL never new if getLocalURL and have the possibility of trying to change the url in cases where they shouldn't and as a result breaking links on wiki with language variants.
- Add GetLocalURL::Internal hook for non-interwiki links. These kinds of links internally use a ugly hack for action=render and an extension using GetLocalURL can be buggy in render mode if they don't re-implement the same ugly hack that MW does. This ::Internal hook runs before the hack does so extension authors don't need to be exposed to our ugly hacky code.
- Add GetLocalURL::Article hook specifically for url tweaks to pretty urls (ie: Only when we would apply $wgArticlePath); This hook avoids the need for extensions that only want to tweak pretty url output. This hook avoids the need to make a bunch of tests for things like !$title->isExternal(), $query == '', and $variant === false which getLocalURL does and could potentially change in the future making wider GetLocalURL hooks change in function requiring extension updates.

12 years agoInstead of using some hacky regexes, just use wfParseUrl() in WikiMap::getDisplayName...
Roan Kattouw [Fri, 12 Aug 2011 19:19:34 +0000 (19:19 +0000)]
Instead of using some hacky regexes, just use wfParseUrl() in WikiMap::getDisplayName(). This should make protocol-relative URLs behave correctly as well, and fix bug 29965

12 years ago* Added LoggedUpdateMaintenance subclass
Aaron Schulz [Fri, 12 Aug 2011 19:11:04 +0000 (19:11 +0000)]
* Added LoggedUpdateMaintenance subclass
* Moved PopulateRevisionLength/PopulateRevisionSha1 scripts to $postDatabaseUpdateMaintenance
* Fixed bogus "{$prefix}_sha1 != ''" comparison (r94362)
* Removed unneeded NOT NULL check (speeds up script a bit) from populateRevisionSha1 script
* Various code cleanups

12 years ago* Added Revision::getSha1 function
Aaron Schulz [Fri, 12 Aug 2011 17:29:57 +0000 (17:29 +0000)]
* Added Revision::getSha1 function
* Try to populate mSha1 when a Revision is made from an array (as rev_len does)

12 years agoGive notice about missing text
Aaron Schulz [Fri, 12 Aug 2011 17:13:28 +0000 (17:13 +0000)]
Give notice about missing text

12 years agoFix for r94289: we want to skip rows with non-empty sha1, not non-NULL (which is...
Aaron Schulz [Fri, 12 Aug 2011 16:50:03 +0000 (16:50 +0000)]
Fix for r94289: we want to skip rows with non-empty sha1, not non-NULL (which is impossible)

12 years agoRenaming qunit test files to end in ".test.js" (finally!)
Krinkle [Fri, 12 Aug 2011 16:02:03 +0000 (16:02 +0000)]
Renaming qunit test files to end in ".test.js" (finally!)

* There shouldn't be two files with the same name in core, especially not the module and the test suite. Previously postponed due to compatibility with our TestSwarm script, that has been fixed now.

* Had to modify the files in the same commit since the module name is referenced inside the test suite in the module() call, which is the hint for QUnit when filtering is done through the ?filter= parameter.

* As has been added to the conventions, there must be only one module() call per test suite file and it MUST match "filename without .test.js". Otherwise the module will not be submitted to TestSwarm (which glob()'s at the /suites/ directory and extracts test-suite-module-names from the filenames).

12 years agoadded doc
Jeroen De Dauw [Fri, 12 Aug 2011 15:42:23 +0000 (15:42 +0000)]
added doc

12 years agoFollow-up r94325: Fix name in module() as well, otherwise TestSwarm chokes
Krinkle [Fri, 12 Aug 2011 15:18:41 +0000 (15:18 +0000)]
Follow-up r94325: Fix name in module() as well, otherwise TestSwarm chokes

12 years agoFollowup r94349; Interwiki::getURL used `$title != null` to test if the $title arg...
Daniel Friesen [Fri, 12 Aug 2011 14:55:25 +0000 (14:55 +0000)]
Followup r94349; Interwiki::getURL used `$title != null` to test if the $title arg was passed and should be substituted. However `"" == null`, so as a result switching to using the argument broke [[mw:]] style interwiki links without an article title.
Update the Interwiki::getURL code to use isset(), and update the comment to tell pre-1.19 supporting extensions to do the entire urlencoding and $1 substitution on their own since Interwiki::getURL was essentially buggy and broken before now.

12 years agoGuard against parse_url() returning weird things in wfParseUrl(). This is not a probl...
Roan Kattouw [Fri, 12 Aug 2011 14:45:37 +0000 (14:45 +0000)]
Guard against parse_url() returning weird things in wfParseUrl(). This is not a problem in practice unless you mess up your local copy badly enough that it tries to do wfParseUrl("%0Aexample.com") like mine just did, but wfParseUrl() should handle all invalid input gracefully without throwing notices.

12 years agoFix r91886 thanks to johnduhart: check if it is an IP *before* stripping subpages...
Robin Pepermans [Fri, 12 Aug 2011 14:32:05 +0000 (14:32 +0000)]
Fix r91886 thanks to johnduhart: check if it is an IP *before* stripping subpages, otherwise IP range blocking does not work

12 years agoUpdate Interwiki::getURL's first argument so that it's properly urlencoded when repla...
Daniel Friesen [Fri, 12 Aug 2011 14:10:37 +0000 (14:10 +0000)]
Update Interwiki::getURL's first argument so that it's properly urlencoded when replacements are made.
Scanning all of core and all the extensions we have in svn, it doesn't look like anyone makes any calls to Interwiki::getURL using the argument so this should be safe enough to clean up the api.
Also update Title::getFullURL to make use of the first arg now.

12 years agoUpdating jquery.form from upstream
Krinkle [Fri, 12 Aug 2011 14:05:12 +0000 (14:05 +0000)]
Updating jquery.form from upstream
* Source: https://github.com/malsup/form/commit/e77e287c8024d200909a7b4f4a1224503814e660

12 years agoUpdating jquery.qunit from upstream
Krinkle [Fri, 12 Aug 2011 14:03:05 +0000 (14:03 +0000)]
Updating jquery.qunit from upstream
* Source: https://github.com/jquery/qunit/commit/75dae0b9b8eb2e8151da502beb7a9c1c399f8dbe

12 years ago(bug 30236) Links like [[//example.com Link text]] were parsed as an internal link...
Roan Kattouw [Fri, 12 Aug 2011 13:32:06 +0000 (13:32 +0000)]
(bug 30236) Links like [[//example.com Link text]] were parsed as an internal link rather than an external link surrounded by brackets, like [[example.com Link text]]. Was caused by another pointless \b directly preceding wfUrlProtocols() in a regex. Also add a parser test for the [[http://example.com Link text]] case (the existing test only covered [[http://example.com]]) and add protocol-relative counterparts for both tests.

12 years agoFollow-up r94289: SQLite support, unbreaks tests
Max Semenik [Fri, 12 Aug 2011 13:16:06 +0000 (13:16 +0000)]
Follow-up r94289: SQLite support, unbreaks tests

12 years agoRN populateSha1.php renamed (r94291)
Antoine Musso [Fri, 12 Aug 2011 11:47:36 +0000 (11:47 +0000)]
RN populateSha1.php renamed (r94291)
(fix r94328)

12 years agomore ajaxCategories fixes based on review in r93351 CR
Krinkle [Fri, 12 Aug 2011 11:35:50 +0000 (11:35 +0000)]
more ajaxCategories fixes based on review in r93351 CR
* Html-escaping unescaped message in summaryHolder
* Check for errors in the API response
* Pass true for existence of redirect origin and value of 'exists' for target (instead of backwards)
* Comment fixes

12 years agoUse [] instead of new Array.
Daniel Friesen [Fri, 12 Aug 2011 10:25:16 +0000 (10:25 +0000)]
Use [] instead of new Array.

12 years agoUse a regex when checking for external urls. It's concise and DRY, less prone to...
Daniel Friesen [Fri, 12 Aug 2011 10:20:17 +0000 (10:20 +0000)]
Use a regex when checking for external urls. It's concise and DRY, less prone to bugs like "Whoops I got that hardcoded length int wrong and created a condition that'll never be true",... and it's 4 time faster ;)

12 years agoFix copy-paste mistake in r94289
Roan Kattouw [Fri, 12 Aug 2011 10:00:09 +0000 (10:00 +0000)]
Fix copy-paste mistake in r94289

12 years agoFix usage of the jQuery global in a few spots.
Daniel Friesen [Fri, 12 Aug 2011 09:27:16 +0000 (09:27 +0000)]
Fix usage of the jQuery global in a few spots.
- jQuery changed to $ in some files because there is a closure that creates a locally scoped $, but the jQuery var is globally scoped, meaning using jQuery instead of $ inside that closure could result in interacting with a different instance of jQuery than the uses of $ in that same closure.
- In mwExtension wrap the code inside a closure which it is missing. Also take this chance to fix the whitespace style `fn( arg )` instead of `fn(arg)` on the isArray I added.
This is partially a followup to r94331.

Note: The jquery plugins inside the jquery/ folder look fine for use of jQuery within closures, except for mockjax.

12 years agoUse jQuery's $.isArray, not instanceof Array. The later has troubles with cross-frame...
Daniel Friesen [Fri, 12 Aug 2011 08:40:34 +0000 (08:40 +0000)]
Use jQuery's $.isArray, not instanceof Array. The later has troubles with cross-frame Array instances, and doesn't use the ES5 native method.

12 years agoReverting r93751 per r93751 CR.
Krinkle [Fri, 12 Aug 2011 08:21:22 +0000 (08:21 +0000)]
Reverting r93751 per r93751 CR.

12 years agoRN populateImageSha1.php renamed (r94291)
Antoine Musso [Fri, 12 Aug 2011 08:16:15 +0000 (08:16 +0000)]
RN populateImageSha1.php renamed (r94291)

12 years agoApply lowerCamelCase to files for constructors as well.
Krinkle [Fri, 12 Aug 2011 06:41:55 +0000 (06:41 +0000)]
Apply lowerCamelCase to files for constructors as well.
(Follows-up r94230)

12 years agoWhitespace
Sam Reed [Thu, 11 Aug 2011 23:58:29 +0000 (23:58 +0000)]
Whitespace

Documentation

12 years agow/s
Mark A. Hershberger [Thu, 11 Aug 2011 22:35:49 +0000 (22:35 +0000)]
w/s

12 years agoFix case of the new file added in r94289
Platonides [Thu, 11 Aug 2011 22:32:29 +0000 (22:32 +0000)]
Fix case of the new file added in r94289

Produced the following fatal on Unix systems when trying to update:
Warning: require(maintenance/PopulateRevisionSha1.php): failed to open stream: No such file or directory in includes/AutoLoader.php on line 922
Fatal error: require(): Failed opening required 'maintenance/PopulateRevisionSha1.php' in includes/AutoLoader.php on line 922

12 years agoRenamed image sha1 population script to be more concise
Aaron Schulz [Thu, 11 Aug 2011 22:00:42 +0000 (22:00 +0000)]
Renamed image sha1 population script to be more concise

12 years agoFollow-up r94289: code changes to fill the new fields on insertion and select them
Aaron Schulz [Thu, 11 Aug 2011 21:54:46 +0000 (21:54 +0000)]
Follow-up r94289: code changes to fill the new fields on insertion and select them

12 years ago* Added rev_sha1 and ar_sha1 columns to revision/archive tables (useful for bug 25312)
Aaron Schulz [Thu, 11 Aug 2011 21:52:54 +0000 (21:52 +0000)]
* Added rev_sha1 and ar_sha1 columns to revision/archive tables (useful for bug 25312)
* Created a script to populate these fields (doesn't handle archive rows without ar_rev_id set though)

12 years ago* Use local context instead of global variables
Alexandre Emsenhuber [Thu, 11 Aug 2011 21:10:30 +0000 (21:10 +0000)]
* Use local context instead of global variables
* Call Linker methods statically

12 years agocode cosmetics: moved the closing td to a new line
Thomas Gries [Thu, 11 Aug 2011 20:57:57 +0000 (20:57 +0000)]
code cosmetics: moved the closing td to a new line

12 years agocorrection of Mixed tabs and spaces (2 tabs and 4 spaces), should use just tabs for...
Thomas Gries [Thu, 11 Aug 2011 20:47:25 +0000 (20:47 +0000)]
correction of Mixed tabs and spaces (2 tabs and 4 spaces), should use just tabs for indentation

12 years agoLocalisation update for core and extension messages from translatewiki.net (2011...
Raimond Spekking [Thu, 11 Aug 2011 20:12:53 +0000 (20:12 +0000)]
Localisation update for core and extension messages from translatewiki.net (2011-08-11 19:50:00)

12 years agoremove stuff accidentally committed in r94279
Robin Pepermans [Thu, 11 Aug 2011 20:03:53 +0000 (20:03 +0000)]
remove stuff accidentally committed in r94279

12 years ago* CategoryPage.php: fix the "category-empty" message per comment on r91518, it was...
Robin Pepermans [Thu, 11 Aug 2011 19:58:23 +0000 (19:58 +0000)]
* CategoryPage.php: fix the "category-empty" message per comment on r91518, it was outside the bodyContent. And do not convert interface text.
* Parser.php: Apparently that was a much bigger bug: do not convert interface text going through the parser either.
* Preferences.php: Do not convert the user signature.
For this bug in action, see e.g. http://sr.wikipedia.org/sr-ec/Посебно:Подешавањ?uselang=en (e.g. "Username" -> "Усернаме")

12 years agoFix Bug #30322 “SVG metadata is read incorrectly” by applying supplied patch
Mark A. Hershberger [Thu, 11 Aug 2011 19:51:51 +0000 (19:51 +0000)]
Fix Bug #30322 “SVG metadata is read incorrectly” by applying supplied patch

12 years agoSolve undefined-message problem by removing it all together. I've moved the .contains...
Krinkle [Thu, 11 Aug 2011 19:14:34 +0000 (19:14 +0000)]
Solve undefined-message problem by removing it all together. I've moved the .containsCat() check to before the $link.length/createCatLink code, now it's always defined.

(Follows-up r93351, r94268)

12 years agoI think 3 and a half years is long enough for the redirection to be left around
Sam Reed [Thu, 11 Aug 2011 19:10:22 +0000 (19:10 +0000)]
I think 3 and a half years is long enough for the redirection to be left around

12 years agoajaxCategories fixes based on review in r93351 CR:
Krinkle [Thu, 11 Aug 2011 19:01:39 +0000 (19:01 +0000)]
ajaxCategories fixes based on review in r93351 CR:
* Using typeof check in clean()
* Use mw.Title to get page title from fullpagename instead of split(':')
* replaceNowikis() and restoreNowikis()
 - Improve documentation
 - Moved dash in the UNIQUEKEY to between the id and the incrementing integer, and made it start with an empty string (so that all following concatenations are toString'ed).
* makeCaseInsensitive(): Moved the wgCaseSensitiveNamespaces-check out and wrapped it around the caller instead. Also cached the outcome of "Is category namespace sensitive ?".
* createButton(): text-argument is indeed text, not html. Applying html-escaping.
* resolveRedirects():
 - Replace access to private property _name of mw.Title with function getMainText().
* handleCategoryAdd() and handleEditLink():
 - Restructure title-handling (no local replace() calls and clean(), let mw.Title handle it)
 - Renaming arguments and documenting them better
 - Renaming local variables and removing redundant parts
 - Preserving sortkey as sortkey as long as possible without the pipe
 - Calling the combination of sortkey and leading pipe 'suffix' instead of, also, sortkey.
* createCatLink():
 - Remove the sanitizing here, the string passed is already clean as it comes from mw.Title now
 - Using .text() instead of .append( which is .html-like), category names can contain special characters.
* containsCat():
 - Using $.each instead of [].filter. Stopping after first match.
* buildRegex(): Allow whitespace before namespace colon, and allow whitespace after category name (but before ]] and |..]])

Additional changes not for any function in particular:
* Literally return null in $.map callbacks.
* Using the existence-system of mw.Title instead of passing around booleans everywhere
** Removed 'exists' argument from the resolveRedirects() and handleCategoryAdd() functions, instead checking .exists() of the mw.Title object.
* Passing and using mw.Title objects where possible instead of converting back and forth between strings and objects etc.
* Using "TitleObj.getUrl()" instead of "catUrl( titleString )". Removed now unused catUrl() function.
* To improve readability, renamed local uses of 'var that = this' to 'var ajaxcat = this'.
* Syntax error fixes (.parent -> .parent())
* Merging var statements
* Renamed generic members of 'stash' from 'stash.summaries' to 'stash.dialogDescriptions' and 'stash.shortSum' to 'stash.editSummaries'. dialogDescription is always HTML (input should be escaped before hand)

12 years agoAllow extensions to add pages with non-wikitext display by adding two new
Victor Vasiliev [Thu, 11 Aug 2011 17:21:31 +0000 (17:21 +0000)]
Allow extensions to add pages with non-wikitext display by adding two new
hooks (generalizing the code already used for CSS/JS pages).

12 years agoAdd 2 @since and add documentation for PageContentLanguage hook
Robin Pepermans [Thu, 11 Aug 2011 14:52:57 +0000 (14:52 +0000)]
Add 2 @since and add documentation for PageContentLanguage hook

12 years agoFix a few comment typos noticed when doing JS review
Roan Kattouw [Thu, 11 Aug 2011 14:47:18 +0000 (14:47 +0000)]
Fix a few comment typos noticed when doing JS review

12 years agoAdd module definition for jquery.qunit.completenessTest and set position to top for...
Krinkle [Thu, 11 Aug 2011 14:28:16 +0000 (14:28 +0000)]
Add module definition for jquery.qunit.completenessTest and set position to top for jquery.qunit (right now it's manually loaded with a <script> tag, but once it's loaded dynamically it should be loaded from top because of the styling and the hooks that it makes available).

12 years agoMake SpecialRecentchangesTest pass
Alexandre Emsenhuber [Thu, 11 Aug 2011 14:13:03 +0000 (14:13 +0000)]
Make SpecialRecentchangesTest pass

12 years agoWe have startParse() for that
Alexandre Emsenhuber [Thu, 11 Aug 2011 13:57:15 +0000 (13:57 +0000)]
We have startParse() for that

12 years agoFollowup r93211, add log_timestamp to end of the index
Sam Reed [Thu, 11 Aug 2011 12:49:30 +0000 (12:49 +0000)]
Followup r93211, add log_timestamp to end of the index

12 years agoOh, right.
Krinkle [Thu, 11 Aug 2011 12:42:31 +0000 (12:42 +0000)]
Oh, right.

IE6/7 doesn't support that.
( Thanks TestSwarm, http://toolserver.org/~krinkle/testswarm/job/289/ )

Changing to a normal raises().

(Follows-up r94237)

12 years agomediawiki.Title fix for IE.
Krinkle [Thu, 11 Aug 2011 12:36:00 +0000 (12:36 +0000)]
mediawiki.Title fix for IE.

In normal browsers the matches-array contains null/undefined if there's no match, IE returns an empty string.

Changing the checks to really validate that it's a non-empty string, which means that from now on mw.Title will also throw an error on "new mw.Title('');", which makes it consistent with the PHP backend (Title::newFromText('') return null instead of an object).

Adding unit test to make sure this behavior is tracked from now on.

The _name and _ext properties are either left to their default (null) or set to a valid value.

So reverting the checks from r94066, and instead checking for empty string inside the byteLimit callback, that way mw.Title will not get the empty string in the first place.

(Follows-up r94066 CR)

12 years agoFollow-up r93383: api param is 'namespace', not 'namespaces'.
Krinkle [Thu, 11 Aug 2011 11:09:53 +0000 (11:09 +0000)]
Follow-up r93383: api param is 'namespace', not 'namespaces'.

12 years agoFollowup r85025, r85166, r93233: use strict comparison per CR comment, because "0...
Roan Kattouw [Thu, 11 Aug 2011 10:33:22 +0000 (10:33 +0000)]
Followup r85025, r85166, r93233: use strict comparison per CR comment, because "0" != "00" is false

12 years agoRename mw.uri to mw.Uri + minor fixes:
Krinkle [Thu, 11 Aug 2011 04:09:34 +0000 (04:09 +0000)]
Rename mw.uri to mw.Uri + minor fixes:

* Renaming mw.uri to mw.Uri (since it's a constructor)
* Leaked global variable 'g' in _parse() fixed
* Removing unused local variable '_this' in getQueryString()
* Fix documentation (jQuery 'setAttr' should be 'attar')
* Making non-private variables with '@private' comment, private (or "local").
* Using strict undefined comparison (shorter and faster, [[JSPERF]])
* Moving Resources definition from MediaWiki Page section to MediaWiki main section (to reflect directory structure)
* Coding style conventions (mixed spaces and tabs, line wrapping, double/single quotes)
* Remove passing mediaWiki to mw argument (mw is a global alias)
* Passes JSHint

* Removing 404 errors from UploadWizard/test/jasmine/SpecRunner.html

(Follows-up r93781 's move)

12 years agoAllow web access to jasmine directory (just like QUnit)
Krinkle [Thu, 11 Aug 2011 03:22:25 +0000 (03:22 +0000)]
Allow web access to jasmine directory (just like QUnit)

12 years agoCoding style commit
Krinkle [Thu, 11 Aug 2011 03:19:29 +0000 (03:19 +0000)]
Coding style commit
* Colon placement
* Trailing whitespace
* Spaces to tabs
* No need for separate var if it's just a single var (waste of space)
* Strict comparison to undefined

12 years agoRenaming jquery.mwPrototypes to jquery.mwExtension
Krinkle [Thu, 11 Aug 2011 03:12:12 +0000 (03:12 +0000)]
Renaming jquery.mwPrototypes to jquery.mwExtension
* Originally they were a few prototypes on the native String object, however they were converted to be (static) members extending the jQuery object. Calling them prototypes is confusing. A grep search on /trunk/ didn't reveal any direct uses of this module (it's loaded by default through mediawiki.util's dependencies)

12 years agoFollowup r94211
Sam Reed [Thu, 11 Aug 2011 00:17:58 +0000 (00:17 +0000)]
Followup r94211

Bug 30315 - Declaration of FauxResponse::setcookie() should be compatible with that of WebResponse::setcookie()

12 years ago(bug 30192) Old thumbnails not properly purged. Unlike the bug suggests, we don't...
Chad Horohoe [Wed, 10 Aug 2011 23:29:08 +0000 (23:29 +0000)]
(bug 30192) Old thumbnails not properly purged. Unlike the bug suggests, we don't need to also purge from LocalFile::purgeCache(), since that code path ends up calling purgeHistory() anyway.

A lot of this could probably be protected...not much calls these outside of FileRepo code other than File::purgeCache()