From: Florent Bruneau Date: Sat, 21 Feb 2009 08:23:20 +0000 (+0100) Subject: Avoid null gids. X-Git-Tag: xorg/0.10.1~49^2~16 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=a1ee34a40854bad35ee0663f17352ec51ab83365;p=platal.git Avoid null gids. Signed-off-by: Florent Bruneau --- diff --git a/core b/core index adc69ce..e94c4a1 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit adc69ced9c75421c5ee596fbd0a3426fffb9940c +Subproject commit e94c4a1713cc0d63508a5d0ecd2d572f047975fb diff --git a/include/validations/medals.inc.php b/include/validations/medals.inc.php index a2a5dc1..dd58bbd 100644 --- a/include/validations/medals.inc.php +++ b/include/validations/medals.inc.php @@ -36,6 +36,9 @@ class MedalReq extends Validate parent::__construct($_user, false, 'medal', $_stamp); $this->mid = $_idmedal; $this->gid = $_subidmedal; + if (is_null($this->gid)) { + $this->gid = 0; + } } // }}} @@ -104,7 +107,8 @@ class MedalReq extends Validate register_watch_op($this->user->id(), WATCH_FICHE, '', 'medals'); return XDB::execute('REPLACE INTO profile_medals_sub VALUES ({?}, {?}, {?})', - $this->user->id(), $this->mid, $this->gid); + $this->user->id(), $this->mid, + is_null($this->gid) ? 0 : $this->gid); } // }}}