Bug fixes
[lhc/web/wiklou.git] / includes / Article.php
index 1cb0dd7..305aaf7 100644 (file)
@@ -493,23 +493,15 @@ class Article {
                        $sql = "UPDATE recentchanges SET rc_cur_time='{$now}' " .
                          "WHERE rc_cur_id=" . $this->getID();
                        wfQuery( $sql, DB_WRITE, $fname );
-                       
+
                        global $wgEnablePersistentLC;
                        if ( $wgEnablePersistentLC ) {
-
-                               // Purge link cache for this page 
+                               // Purge link cache for this page
                                $pageid=$this->getID();
                                wfQuery("DELETE FROM linkscc WHERE lcc_pageid='{$pageid}'", DB_WRITE);
-
-                               // This next query just makes sure stub colored links to this page 
-                               // are updated correctly (I think). If performance is more important
-                               // than real-time updating of stub links, we really should skip
-                               // this query.
-                               wfQuery("DELETE linkscc FROM linkscc,links ".
-                                       "WHERE lcc_title=links.l_from AND l_to={$pageid}", DB_WRITE);
-                       }
-
+                       }                       
                }
+
                if( $wgDBtransactions ) {
                        $sql = "COMMIT";
                        wfQuery( $sql, DB_WRITE );
@@ -1024,6 +1016,11 @@ class Article {
                $wgOut->addHTML( "<h2>" . $newcomment . "</h2>\n<hr>\n" );
                $this->updateArticle( $s->old_text, $newcomment, 1, $this->mTitle->userIsWatching() );
 
+               global $wgEnablePersistentLC;
+               if ( $wgEnablePersistentLC ) {
+                       wfQuery("DELETE FROM linkscc WHERE lcc_pageid='{$pid}'", DB_WRITE);
+               }
+       
                $wgOut->returnToMain( false );
        }
        
@@ -1077,13 +1074,13 @@ class Article {
                          $this->mTitle->getDBkey() );
                        array_push( $wgDeferredUpdateList, $u );
 
-                       if ( $this->getNamespace == NS_MEDIAWIKI ) {
+                       if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
                                $messageCache = $wgMemc->get( "$wgDBname:messages" );
                                if (!$messageCache) {
                                        $messageCache = wfLoadAllMessages();
                                }
-                               $messageCache[$title] = $text;
-                               $wgMemc->set( "$wgDBname:messages" );
+                               $messageCache[$this->mTitle->getDBkey()] = $text;
+                               $wgMemc->set( "$wgDBname:messages", $messageCache, 86400 );
                        }
                }
        }