Commit graph

15 commits

Author SHA1 Message Date
Szymon Świerkosz
bde989e74c Add support for User:0 in 'user' and 'user.groups' RL modules.
Change-Id: I290e44166306036629ada990e233f098558c2aea
2012-05-10 20:12:13 +02:00
Alexandre Emsenhuber
7d9016943d Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I1815587ab2eeb24623ce4bf1c695088bd3f1c2ea
2012-04-30 09:16:10 +02:00
Alexandre Emsenhuber
6edec11373 Check that the result of Title::makeTitleSafe() is an object before calling a method on it.
Change-Id: If23fb3a5900cee6a5c4b3c24b44ce7f3da308bf3
Title::makeTitleSafe() does not always return a Title object, e.g. calling load.php?modules=user&user=| resulted in a fatal error.
2012-04-09 10:30:50 +02:00
Sam Reed
f8a0e34ca1 Documentation
Trim trailing whitespace

Make returns return values where appropriate (ie other paths in the same method do)
2011-10-14 08:06:54 +00:00
Roan Kattouw
bbb3796990 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. 2011-08-17 14:55:06 +00:00
Roan Kattouw
2ace1260fb (bug 26283) Previewing user JS/CSS pages doesn't load other user JS/CSS pages 2011-08-13 17:27:35 +00:00
Sam Reed
16c194d0ae Fixup/add documentation
Remove trailing whitespace
2011-05-21 17:45:20 +00:00
Sam Reed
c0830dd868 2 subclasses of ResourceLoaderWikiModule implement a duplicate version of getFlip. Move it up into ResourceLoaderWikiModule
(Almost looks like it could all go into ResourceLoaderModule... But that uses a different version, seemingly, the only one. 3 other subclasses of ResourceLoaderModule implement the same version of getFlip as is moved into a parent class here... Seems daft to have a different version in the base abstract class... Minor oversight?)

Some documentation
2011-02-18 00:33:45 +00:00
Roan Kattouw
f29d0359d1 Apply $wgContLang-based flip logic to site and user modules too. I swear we did this at some point 2011-02-11 09:27:02 +00:00
Tim Starling
fc6f65a85b Fixes for ResourceLoaderWikiModule r72776. No serious bugs found, do not merge before deployment.
* Specify page titles as strings instead of split NS/DBK, as suggested by Roan on CR. It seemed sensible to me.
* Pass a Title object to getContent() instead of a string, to avoid unnecessary object construction overhead
* "*" and "/" are valid title characters. Check module input for JS comment end tokens.
* Fixed inappropriate conversion to boolean, when checking result of getContent(). Presumably the idea was to omit empty sections and errors, so that's what I did. Maybe an informative error message would be better in the error case.
* Use LinkBatch for selecting multiple page rows instead of Database::makeWhereFrom2d(). 
* Fixed assignment expression.
2011-02-08 06:34:38 +00:00
Happy-melon
da36f65433 Follow-up r64670 (bug22929): cleaner implementation of security for script (and potentially CSS) files. ResourceLoader *already* knows where each module has come from, so all we need to do is filter them in OutputPage according to the desired level of 'trustworthiness'.
TODO:
* Are there instances where we might want to restrict CSS as well as JS?
* Would a $wg config option and/or user preference and/or index.php GET parameter to limit inclusion be useful?
* Can we deprecate any of the existing $wg config options?
* What's going on with the duplicated code between OutputPage and SkinTemplate?
2011-02-04 16:39:17 +00:00
Roan Kattouw
94c7c847d0 Remove unnecessary check against $wgAllowUserCss in ResourceLoaderUserModule that was used to trigger JS as well as CSS, breaking installs where user JS is allowed but user CSS is not. Callers already check for the relevant $wgAllow* variables before including this module. 2010-12-08 20:10:11 +00:00
Tim Starling
06b2b1bd66 Resource loader minor changes. Fix for r73668 etc.
* Break long lines.
* Convert long or unnecessary ternary operator usages to if/else.
* Fixed excessively clever assignment expressions.
* Rename $cache to $cacheEntry.
* Removed unnecessary web invocation guards. Their perlish form was making me uncomfortable. BTW, unlike in Perl, die() is not a function, it's a special case in the PHP grammar which very roughly simulates the Perl syntax:

die "x"; // works
0 || die("x"); // works
0 || (die); // works
0 || (die "x"); // fail!
2010-11-03 07:58:03 +00:00
Trevor Parscal
70bae52c12 Part 2 of 2, moved ResourceLoader*Module classes to their own files - this commit removes the non file specific code. 2010-10-19 18:31:09 +00:00
Trevor Parscal
032ef610dd Part 1 of 2, moving ResourceLoader*Module classes to their own files - this commit copies the ResourceLoaderModules.php file to each of the new files, as to maintain revision history. The next revision will remove non file specific code. 2010-10-19 18:25:42 +00:00