Merge "Protected function UploadBase->validateName changed to public"
[lhc/web/wiklou.git] / includes / Title.php
index 80be529..a40e444 100644 (file)
@@ -4070,8 +4070,8 @@ class Title {
 
                if ( $res->numRows() > 0 ) {
                        foreach ( $res as $row ) {
-                               // $data[] = Title::newFromText($wgContLang->getNSText ( NS_CATEGORY ).':'.$row->cl_to);
-                               $data[$wgContLang->getNSText( NS_CATEGORY ) . ':' . $row->cl_to] = $this->getFullText();
+                               // $data[] = Title::newFromText($wgContLang->getNsText ( NS_CATEGORY ).':'.$row->cl_to);
+                               $data[$wgContLang->getNsText( NS_CATEGORY ) . ':' . $row->cl_to] = $this->getFullText();
                        }
                }
                return $data;
@@ -4501,23 +4501,30 @@ class Title {
         */
        public function invalidateCache() {
                global $wgMemc;
+
                if ( wfReadOnly() ) {
                        return false;
                }
+
                $dbw = wfGetDB( DB_MASTER );
-               $success = $dbw->update(
-                       'page',
-                       array( 'page_touched' => $dbw->timestamp() ),
-                       $this->pageCond(),
-                       __METHOD__
-               );
+               $conds = $this->pageCond();
+               $dbw->onTransactionIdle( function() use ( $dbw, $conds ) {
+                       $dbw->update(
+                               'page',
+                               array( 'page_touched' => $dbw->timestamp() ),
+                               $conds,
+                               __METHOD__
+                       );
+               } );
                HTMLFileCache::clearFileCache( $this );
 
                // Clear page info.
                $revision = WikiPage::factory( $this )->getRevision();
-               if( $revision !== null ) {
+               if ( $revision !== null ) {
                        $memcKey = wfMemcKey( 'infoaction', $this->getPrefixedText(), $revision->getId() );
-                       $success = $success && $wgMemc->delete( $memcKey );
+                       $success = $wgMemc->delete( $memcKey );
+               } else {
+                       $success = true;
                }
 
                return $success;