Tiny changes, fix comment, remove unused globals and throw and exception instead...
authorPlatonides <platonides@users.mediawiki.org>
Wed, 29 Sep 2010 15:54:43 +0000 (15:54 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Wed, 29 Sep 2010 15:54:43 +0000 (15:54 +0000)
includes/Article.php
includes/MessageCache.php
includes/ResourceLoader.php
maintenance/tests/phpunit/includes/api/ApiSetup.php

index 300c256..3c8f987 100644 (file)
@@ -853,7 +853,7 @@ class Article {
                                $wgOut->setETag( $parserCache->getETag( $this, $parserOptions ) );
                        }
 
-                       # Is is client cached?
+                       # Is it client cached?
                        if ( $wgOut->checkLastModified( $this->getTouched() ) ) {
                                wfDebug( __METHOD__ . ": done 304\n" );
                                wfProfileOut( __METHOD__ );
index 6b8860c..df572c8 100644 (file)
@@ -546,6 +546,8 @@ class MessageCache {
                }
 
                $lang = wfGetLangObj( $langcode );
+               if (!$lang) throw new MWException( "Bad lang code $langcode given" );
+
                $langcode = $lang->getCode();
 
                $message = false;
index 484329b..5647f69 100644 (file)
@@ -327,8 +327,6 @@ class ResourceLoader {
        }
 
        public static function makeModuleResponse( ResourceLoaderContext $context, array $modules, $missing = null ) {
-               global $wgUser;
-               
                // Pre-fetch blobs
                $blobs = $context->shouldIncludeMessages() ?
                        MessageBlobStore::get( array_keys( $modules ), $context->getLanguage() ) : array();
index 2301437..5e108d2 100644 (file)
@@ -7,8 +7,7 @@ abstract class ApiTestSetup extends PHPUnit_Framework_TestCase {
        protected static $apiUrl;
 
        function setUp() {
-               global $wgServer, $wgContLang, $wgAuth, $wgScriptPath,
-                       $wgScriptExtension, $wgMemc, $wgRequest;
+               global $wgServer, $wgContLang, $wgAuth, $wgMemc, $wgRequest;
 
                self::$apiUrl = $wgServer . wfScript( 'api' );