From 2788aaeb1a463012cfa90bf31f5efb4bf6ca7344 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 26 Dec 2013 02:50:58 +0100 Subject: Problème ctype_digit qui ne marche pas sur des variables qui sont déjà des entiers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Feed.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/Models/Feed.php') diff --git a/app/Models/Feed.php b/app/Models/Feed.php index dcf97d4ec..3008e33d7 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -154,7 +154,8 @@ class FreshRSS_Feed extends Minz_Model { $this->lastUpdate = $value; } public function _priority ($value) { - $this->priority = ctype_digit ($value) ? intval ($value) : 10; + $value = intval($value); + $this->priority = $value >= 0 ? $value : 10; } public function _pathEntries ($value) { $this->pathEntries = $value; @@ -172,10 +173,10 @@ class FreshRSS_Feed extends Minz_Model { $this->keep_history = $value; } public function _nbNotRead ($value) { - $this->nbNotRead = ctype_digit ($value) ? intval ($value) : -1; + $this->nbNotRead = intval($value); } public function _nbEntries ($value) { - $this->nbEntries = ctype_digit ($value) ? intval ($value) : -1; + $this->nbEntries = intval($value); } public function load () { -- cgit v1.2.3