Merge "Api method documentation tweaks"
[lhc/web/wiklou.git] / includes / WikiPage.php
index 670b36e..6d9170a 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 );
@@ -1487,6 +1487,10 @@ class WikiPage extends Page {
 
                                wfProfileOut( __METHOD__ );
                                return $status;
+                       } elseif ( $oldtext === false ) {
+                               # Sanity check for bug 37225
+                               wfProfileOut( __METHOD__ );
+                               throw new MWException( "Could not find text for current revision {$oldid}." );
                        }
 
                        $revision = new Revision( array(
@@ -2602,7 +2606,7 @@ class WikiPage extends Page {
                if ( is_object( $rt ) && ( !is_object( $ot ) || !$rt->equals( $ot ) || $ot->getFragment() != $rt->getFragment() ) ) {
                        $truncatedtext = $wgContLang->truncate(
                                str_replace( "\n", ' ', $newtext ),
-                               max( 0, 250
+                               max( 0, 255
                                        - strlen( wfMsgForContent( 'autoredircomment' ) )
                                        - strlen( $rt->getFullText() )
                                ) );