From: Chad Horohoe Date: Tue, 7 Jun 2011 18:13:21 +0000 (+0000) Subject: Fix (Api)BlockTest for Sqlite. getRangeStart()/getRangeEnd() were returning null... X-Git-Tag: 1.31.0-rc.0~29633 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=e1d01b4d7bde769f4bf370b409065b90fbfffff8;p=lhc%2Fweb%2Fwiklou.git Fix (Api)BlockTest for Sqlite. getRangeStart()/getRangeEnd() were returning null for user blocks, which was then happily inserted into a NOT NULL column. The IGNORE was just masking the real error. Thanks Brion and MaxSem. Oh, and ping r84475 --- diff --git a/includes/Block.php b/includes/Block.php index fb294f1fb0..2856824925 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -703,7 +703,7 @@ class Block { public function getRangeStart() { switch( $this->type ) { case self::TYPE_USER: - return null; + return ''; case self::TYPE_IP: return IP::toHex( $this->target ); case self::TYPE_RANGE: @@ -720,7 +720,7 @@ class Block { public function getRangeEnd() { switch( $this->type ) { case self::TYPE_USER: - return null; + return ''; case self::TYPE_IP: return IP::toHex( $this->target ); case self::TYPE_RANGE: