Update
[lhc/web/wiklou.git] / includes / Title.php
index f632392..2225aa3 100644 (file)
@@ -1253,7 +1253,8 @@ class Title {
 
        /**
         * Is this title subject to title protection?
-        * @return array An associative array representing any existent title protection.
+        * @return mixed An associative array representing any existent title
+        *   protection, or false if there's none.
         */
        public function getTitleProtection() {
                $dbr = wfGetDB( DB_SLAVE );
@@ -2305,7 +2306,7 @@ class Title {
                        }
                } else {
                        $tp = $nt->getTitleProtection();
-                       if (!$wgUser->isAllowed($tp['pt_create_perm'])) {
+                       if ( $tp and !$wgUser->isAllowed( $tp['pt_create_perm'] ) ) {
                                return 'cantmove-titleprotected';
                        }
                }
@@ -2381,6 +2382,12 @@ class Title {
                }
                if( $u )
                        $u->doUpdate();
+               # Update message cache for interface messages
+               if( $nt->getNamespace() == NS_MEDIAWIKI ) {
+                       global $wgMessageCache;
+                       $newarticle = new Article( $nt );
+                       $wgMessageCache->replace( $nt->getDBkey(), $newarticle->getContent() );
+               }
                
                global $wgUser;
                wfRunHooks( 'TitleMoveComplete', array( &$this, &$nt, &$wgUser, $pageid, $redirid ) );
@@ -2906,4 +2913,4 @@ class Title {
                return Namespace::isContent( $this->getNamespace() );
        }
        
-}
\ No newline at end of file
+}