$conditions,
__METHOD__ );
- $result = $dbw->affectedRows() != 0;
+ $result = $dbw->affectedRows() > 0;
if ( $result ) {
$this->updateRedirectOn( $dbw, $rt, $lastRevIsRedirect );
$this->setLastEdit( $revision );
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(
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() )
) );