Use NULL not empty string for rc_ip if our DB is picky.
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Wed, 16 Aug 2006 00:59:34 +0000 (00:59 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Wed, 16 Aug 2006 00:59:34 +0000 (00:59 +0000)
includes/RecentChange.php

index 4361ca3..3f91074 100644 (file)
@@ -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']);