Tweaked mysql_affected_rows() check in WikiPage since it can return -1.
authorAaron <aschulz@wikimedia.org>
Thu, 5 Jul 2012 20:54:33 +0000 (13:54 -0700)
committerAaron <aschulz@wikimedia.org>
Thu, 5 Jul 2012 20:54:42 +0000 (13:54 -0700)
In theory, a DBError or something should be thrown already; this is just for sanity.

Change-Id: Ie54dc764ee4d4c6e450b7bcff5663c1707027c6d

includes/WikiPage.php

index 670b36e..43932a7 100644 (file)
@@ -1181,7 +1181,7 @@ class WikiPage extends Page {
                        $conditions,
                        __METHOD__ );
 
-               $result = $dbw->affectedRows() != 0;
+               $result = $dbw->affectedRows() > 0;
                if ( $result ) {
                        $this->updateRedirectOn( $dbw, $rt, $lastRevIsRedirect );
                        $this->setLastEdit( $revision );