http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73951

Revision: 73951
Author:   platonides
Date:     2010-09-29 15:54:43 +0000 (Wed, 29 Sep 2010)

Log Message:
-----------
Tiny changes, fix comment, remove unused globals and throw and exception 
instead of a fatal if given a wrong langcode.

Modified Paths:
--------------
    trunk/phase3/includes/Article.php
    trunk/phase3/includes/MessageCache.php
    trunk/phase3/includes/ResourceLoader.php
    trunk/phase3/maintenance/tests/phpunit/includes/api/ApiSetup.php

Modified: trunk/phase3/includes/Article.php
===================================================================
--- trunk/phase3/includes/Article.php   2010-09-29 15:47:56 UTC (rev 73950)
+++ trunk/phase3/includes/Article.php   2010-09-29 15:54:43 UTC (rev 73951)
@@ -853,7 +853,7 @@
                                $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__ );

Modified: trunk/phase3/includes/MessageCache.php
===================================================================
--- trunk/phase3/includes/MessageCache.php      2010-09-29 15:47:56 UTC (rev 
73950)
+++ trunk/phase3/includes/MessageCache.php      2010-09-29 15:54:43 UTC (rev 
73951)
@@ -546,6 +546,8 @@
                }
 
                $lang = wfGetLangObj( $langcode );
+               if (!$lang) throw new MWException( "Bad lang code $langcode 
given" );
+
                $langcode = $lang->getCode();
 
                $message = false;

Modified: trunk/phase3/includes/ResourceLoader.php
===================================================================
--- trunk/phase3/includes/ResourceLoader.php    2010-09-29 15:47:56 UTC (rev 
73950)
+++ trunk/phase3/includes/ResourceLoader.php    2010-09-29 15:54:43 UTC (rev 
73951)
@@ -327,8 +327,6 @@
        }
 
        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();

Modified: trunk/phase3/maintenance/tests/phpunit/includes/api/ApiSetup.php
===================================================================
--- trunk/phase3/maintenance/tests/phpunit/includes/api/ApiSetup.php    
2010-09-29 15:47:56 UTC (rev 73950)
+++ trunk/phase3/maintenance/tests/phpunit/includes/api/ApiSetup.php    
2010-09-29 15:54:43 UTC (rev 73951)
@@ -7,8 +7,7 @@
        protected static $apiUrl;
 
        function setUp() {
-               global $wgServer, $wgContLang, $wgAuth, $wgScriptPath,
-                       $wgScriptExtension, $wgMemc, $wgRequest;
+               global $wgServer, $wgContLang, $wgAuth, $wgMemc, $wgRequest;
 
                self::$apiUrl = $wgServer . wfScript( 'api' );
 



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to