diff options
author | Chad Horohoe <demon@users.mediawiki.org> | 2010-03-12 22:59:19 +0000 |
---|---|---|
committer | Chad Horohoe <demon@users.mediawiki.org> | 2010-03-12 22:59:19 +0000 |
commit | 608692addd30f04044c2d0abc159955eb3694e5f (patch) | |
tree | bd428309f1a57001ce16ec1633028c28da419681 | |
parent | 815ebdcfb06c672e0b5d1ec81c1a8d54b2ebbc37 (diff) | |
download | mediawikicore-608692addd30f04044c2d0abc159955eb3694e5f.tar.gz mediawikicore-608692addd30f04044c2d0abc159955eb3694e5f.zip |
Backport r63656, r63658 to REL1_161.16.0beta1
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/63659
-rw-r--r-- | includes/AutoLoader.php | 11 | ||||
-rw-r--r-- | maintenance/tests/SanitizerTest.php | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 4de8cda7d554..cecb53f912a7 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -664,6 +664,17 @@ class AutoLoader { } } } + + /** + * Force a class to be run through the autoloader, helpful for things like + * Sanitizer that have define()s outside of their class definition. Of course + * this wouldn't be necessary if everything in MediaWiki was class-based. Sigh. + * + * @return Boolean Return the results of class_exists() so we know if we were successful + */ + static function loadClass( $class ) { + return class_exists( $class ); + } } function wfLoadAllExtensions() { diff --git a/maintenance/tests/SanitizerTest.php b/maintenance/tests/SanitizerTest.php index 6fb9d5a59b43..8a2287d55891 100644 --- a/maintenance/tests/SanitizerTest.php +++ b/maintenance/tests/SanitizerTest.php @@ -1,10 +1,12 @@ <?php -global $IP; -require_once( "$IP/includes/Sanitizer.php" ); class SanitizerTest extends PHPUnit_Framework_TestCase { + function setUp() { + AutoLoader::loadClass( 'Sanitizer' ); + } + function testDecodeNamedEntities() { $this->assertEquals( "\xc3\xa9cole", |