From: Aaron Schulz Date: Fri, 11 May 2012 22:33:58 +0000 (+0000) Subject: Merge "add Interwiki::selectFields" X-Git-Tag: 1.31.0-rc.0~23637 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=50adb91feecb9033eb76a07eae89a47835a51258;hp=38a2cd320a38a7f73172e9a4d2871fa758dc3680;p=lhc%2Fweb%2Fwiklou.git Merge "add Interwiki::selectFields" --- diff --git a/includes/Namespace.php b/includes/Namespace.php index bdccca16eb..9ec69482f3 100644 --- a/includes/Namespace.php +++ b/includes/Namespace.php @@ -361,7 +361,7 @@ class MWNamespace { * @param $index int Index to check * @return bool */ - public static function isNonincludableNamespace( $index ) { + public static function isNonincludable( $index ) { global $wgNonincludableNamespaces; return $wgNonincludableNamespaces && in_array( $index, $wgNonincludableNamespaces ); } diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index fc5d7bb365..e7102e0011 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -216,7 +216,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { $data[$ns]['content'] = ''; } - if ( MWNamespace::isNonincludableNamespace( $ns ) ) { + if ( MWNamespace::isNonincludable( $ns ) ) { $data[$ns]['nonincludable'] = ''; } } diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index 6d8ece1e01..1ba6a3b66e 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -727,4 +727,12 @@ class NewUsersLogFormatter extends LogFormatter { } return parent::getComment(); } + + public function getPreloadTitles() { + if ( $this->entry->getSubtype() === 'create2' ) { + //add the user talk to LinkBatch for the userLink + return array( Title::makeTitle( NS_USER_TALK, $this->entry->getTarget()->getText() ) ); + } + return array(); + } } diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index ba7ff6055c..fa98dbf6a4 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3309,7 +3309,7 @@ class Parser { $isHTML = true; $this->disableCache(); } - } elseif ( MWNamespace::isNonincludableNamespace( $title->getNamespace() ) ) { + } elseif ( MWNamespace::isNonincludable( $title->getNamespace() ) ) { $found = false; # access denied wfDebug( __METHOD__.": template inclusion denied for " . $title->getPrefixedDBkey() ); } else { diff --git a/includes/specials/SpecialLockdb.php b/includes/specials/SpecialLockdb.php index c1453518e9..d71ac6e191 100644 --- a/includes/specials/SpecialLockdb.php +++ b/includes/specials/SpecialLockdb.php @@ -87,13 +87,11 @@ class SpecialLockdb extends FormSpecialPage { } fwrite( $fp, $data['Reason'] ); $timestamp = wfTimestampNow(); - fwrite( $fp, "\n

" . wfMsgExt( - 'lockedbyandtime', - array( 'content', 'parsemag' ), + fwrite( $fp, "\n

" . $this->msg( 'lockedbyandtime', $this->getUser()->getName(), - $wgContLang->date( $timestamp ), - $wgContLang->time( $timestamp ) - ) . "

\n" ); + $wgContLang->date( $timestamp, false, false ), + $wgContLang->time( $timestamp, false, false ) + )->inContentLanguage()->text() . "

\n" ); fclose( $fp ); return Status::newGood(); diff --git a/includes/specials/SpecialRandompage.php b/includes/specials/SpecialRandompage.php index 0b6239bb23..307088ed35 100644 --- a/includes/specials/SpecialRandompage.php +++ b/includes/specials/SpecialRandompage.php @@ -85,7 +85,7 @@ class RandomPage extends SpecialPage { $nsNames = array(); foreach( $this->namespaces as $n ) { if( $n === NS_MAIN ) { - $nsNames[] = wfMsgNoTrans( 'blanknamespace' ); + $nsNames[] = $this->msg( 'blanknamespace' )->plain(); } else { $nsNames[] = $wgContLang->getNsText( $n ); } diff --git a/includes/specials/SpecialUserlogout.php b/includes/specials/SpecialUserlogout.php index d747448f97..ab2bf0ac4b 100644 --- a/includes/specials/SpecialUserlogout.php +++ b/includes/specials/SpecialUserlogout.php @@ -39,7 +39,7 @@ class SpecialUserlogout extends UnlistedSpecialPage { */ if ( isset( $_SERVER['REQUEST_URI'] ) && strpos( $_SERVER['REQUEST_URI'], '&' ) !== false ) { wfDebug( "Special:Userlogout request {$_SERVER['REQUEST_URI']} looks suspicious, denying.\n" ); - throw new HttpError( 400, wfMessage( 'suspicious-userlogout' ), wfMessage( 'loginerror' ) ); + throw new HttpError( 400, $this->msg( 'suspicious-userlogout' ), $this->msg( 'loginerror' ) ); } $this->setHeaders(); diff --git a/includes/specials/SpecialWantedfiles.php b/includes/specials/SpecialWantedfiles.php index 25b93b15a4..2475189147 100644 --- a/includes/specials/SpecialWantedfiles.php +++ b/includes/specials/SpecialWantedfiles.php @@ -39,7 +39,7 @@ class WantedFilesPage extends WantedQueryPage { # Specifically setting to use "Wanted Files" (NS_MAIN) as title, so as to get what # category would be used on main namespace pages, for those tricky wikipedia # admins who like to do {{#ifeq:{{NAMESPACE}}|foo|bar|....}}. - $catMessage = wfMessage( 'broken-file-category' ) + $catMessage = $this->msg( 'broken-file-category' ) ->title( Title::newFromText( "Wanted Files", NS_MAIN ) ) ->inContentLanguage(); diff --git a/resources/Resources.php b/resources/Resources.php index f1861833b1..34b9be6732 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -76,7 +76,7 @@ return array( 'common/commonContent.css' => array( 'media' => 'screen' ), 'common/commonInterface.css' => array( 'media' => 'screen' ), 'vector/screen.css' => array( 'media' => 'screen' ), - 'vector/screen-hd.css' => array( 'media' => 'screen and (min-width: 900px)' ), + 'vector/screen-hd.css' => array( 'media' => 'screen and (min-width: 982px)' ), ), 'scripts' => 'vector/vector.js', 'remoteBasePath' => $GLOBALS['wgStylePath'], diff --git a/tests/phpunit/includes/MWNamespaceTest.php b/tests/phpunit/includes/MWNamespaceTest.php index d4590228cf..da36ffda40 100644 --- a/tests/phpunit/includes/MWNamespaceTest.php +++ b/tests/phpunit/includes/MWNamespaceTest.php @@ -546,6 +546,15 @@ class MWNamespaceTest extends MediaWikiTestCase { } + public function testIsNonincludable() { + global $wgNonincludableNamespaces; + $wgNonincludableNamespaces = array( NS_USER ); + + $this->assertTrue( MWNamespace::isNonincludable( NS_USER ) ); + + $this->assertFalse( MWNamespace::isNonincludable( NS_TEMPLATE ) ); + } + ####### HELPERS ########################################################### function __call( $method, $args ) { // Call the real method if it exists