(bug 13745) Fix regression from r33133 by changing INSERT to REPLACE
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 15 Apr 2008 18:32:48 +0000 (18:32 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 15 Apr 2008 18:32:48 +0000 (18:32 +0000)
includes/Article.php

index 7899d45..473d19a 100644 (file)
@@ -96,11 +96,11 @@ class Article {
                if(!$retval)
                        return null;
                $dbw = wfGetDB(DB_MASTER);
-               $dbw->insert('redirect', array(
+               $dbw->replace('redirect', array('rd_from'), array(
                                'rd_from' => $this->getID(),
                                'rd_namespace' => $retval->getNamespace(),
                                'rd_title' => $retval->getDBKey()
-               ));
+               ), __METHOD__);
                return $retval;
        }