From: Greg Sabino Mullane Date: Wed, 16 Aug 2006 00:59:34 +0000 (+0000) Subject: Use NULL not empty string for rc_ip if our DB is picky. X-Git-Tag: 1.31.0-rc.0~55973 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%2C%22id_auteur=%24connecte%22%29%20.%20%22?a=commitdiff_plain;h=4b6d775b379d936274e19ee894461de74ed9d929;p=lhc%2Fweb%2Fwiklou.git Use NULL not empty string for rc_ip if our DB is picky. --- diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 4361ca3cce..3f91074f36 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -108,6 +108,11 @@ class RecentChange $this->mAttribs['rc_ip'] = ''; } + ## If our database is strict about IP addresses, use NULL instead of an empty string + if ( $dbw->strictIPs() and $this->mAttribs['rc_ip'] == '' ) { + unset( $this->mAttribs['rc_ip'] ); + } + # Fixup database timestamps $this->mAttribs['rc_timestamp'] = $dbw->timestamp($this->mAttribs['rc_timestamp']); $this->mAttribs['rc_cur_time'] = $dbw->timestamp($this->mAttribs['rc_cur_time']);