Merge "objectcache: Add some newlines to WANObjectCache docs"
[lhc/web/wiklou.git] / includes / Title.php
index fac45d0..eac712b 100644 (file)
@@ -206,7 +206,7 @@ class Title {
         * @return TitleFormatter
         */
        private static function getTitleFormatter() {
-               //NOTE: we know that getTitleParser() returns a MediaWikiTitleCodec,
+               // NOTE: we know that getTitleParser() returns a MediaWikiTitleCodec,
                //      which implements TitleFormatter.
                return self::getTitleParser();
        }
@@ -266,7 +266,11 @@ class Title {
                        throw new InvalidArgumentException( '$text must be a string.' );
                } elseif ( !is_string( $text ) ) {
                        wfDebugLog( 'T76305', wfGetAllCallers( 5 ) );
-                       wfWarn( __METHOD__ . ': $text must be a string. This will throw an InvalidArgumentException in future.', 2 );
+                       wfWarn(
+                               __METHOD__ . ': $text must be a string. ' .
+                                       'This will throw an InvalidArgumentException in future.',
+                               2
+                       );
                }
 
                try {
@@ -1939,7 +1943,6 @@ class Title {
         *   - quick  : does cheap permission checks from slaves (usable for GUI creation)
         *   - full   : does cheap and expensive checks possibly from a slave
         *   - secure : does cheap and expensive checks, using the master as needed
-        * @param bool $short Set this to true to stop after the first permission error.
         * @param array $ignoreErrors Array of Strings Set this to a list of message keys
         *   whose corresponding errors may be ignored.
         * @return array Array of arguments to wfMessage to explain permissions problems.
@@ -2945,7 +2948,7 @@ class Title {
                                        $this->mRestrictions['move'] = explode( ',', trim( $temp[0] ) );
                                } else {
                                        $restriction = trim( $temp[1] );
-                                       if ( $restriction != '' ) { //some old entries are empty
+                                       if ( $restriction != '' ) { // some old entries are empty
                                                $this->mRestrictions[$temp[0]] = explode( ',', $restriction );
                                        }
                                }
@@ -4547,15 +4550,17 @@ class Title {
        public function isValidRedirectTarget() {
                global $wgInvalidRedirectTargets;
 
-               // invalid redirect targets are stored in a global array, but explicitly disallow Userlogout here
-               if ( $this->isSpecial( 'Userlogout' ) ) {
-                       return false;
-               }
-
-               foreach ( $wgInvalidRedirectTargets as $target ) {
-                       if ( $this->isSpecial( $target ) ) {
+               if ( $this->isSpecialPage() ) {
+                       // invalid redirect targets are stored in a global array, but explicitly disallow Userlogout here
+                       if ( $this->isSpecial( 'Userlogout' ) ) {
                                return false;
                        }
+
+                       foreach ( $wgInvalidRedirectTargets as $target ) {
+                               if ( $this->isSpecial( $target ) ) {
+                                       return false;
+                               }
+                       }
                }
 
                return true;