# Now that it's safely backed up, delete it
$dbw->delete( 'page', array( 'page_id' => $id ), __METHOD__);
- $ok = ( $dbw->affectedRows() > 0 ); // getArticleId() uses slave, could be laggy
+ $ok = ( $dbw->affectedRows() != 0 ); // getArticleId() uses slave, could be laggy
if( !$ok ) {
$dbw->rollback();
return false;
/**
* Insert a block into the block table.
- * @param Database $dbw, optional
* @return Whether or not the insertion was successful.
*/
- function insert( $dbw = NULL)
+ function insert()
{
wfDebug( "Block::insert; timestamp {$this->mTimestamp}\n" );
- $dbw = $dbw ? $dbw : wfGetDB( DB_MASTER );
+ $dbw = wfGetDB( DB_MASTER );
# Unset ipb_anon_only for user blocks, makes no sense
if ( $this->mUser ) {
$dbw->insert( 'logging', $data, $fname );
$newId = $dbw->insertId();
+ $ok = ($dbw->affectedRows() != 0);
# And update recentchanges
if( $this->updateRecentChanges ) {
# Don't add private logs to RC!
$this->type, $this->action, $this->target, $this->comment, $this->params, $newId );
}
}
- return ($dbw->affectedRows() > 0);
+ return $ok;
}
public function getRcComment() {
if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) {
$dbw = wfGetDB( DB_MASTER );
$dbw->begin();
- if ( !$block->insert( $dbw ) ) {
+ if ( !$block->insert() ) {
$dbw->rollback(); // this could be commit as well; zero rows either way
return array('ipb_already_blocked', htmlspecialchars($this->BlockAddress));
}