aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Configuration.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-26 02:50:58 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-26 02:50:58 +0100
commit2788aaeb1a463012cfa90bf31f5efb4bf6ca7344 (patch)
tree990d4b1ccd91cf59a9ec8bab4a15c356c4d1a55d /app/Models/Configuration.php
parent6d13bdac0c03598f34fa3cf8298b6510c41b345e (diff)
Problème ctype_digit qui ne marche pas sur des variables qui sont déjà des entiers
Diffstat (limited to 'app/Models/Configuration.php')
-rw-r--r--app/Models/Configuration.php16
1 files changed, 5 insertions, 11 deletions
diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php
index 47509636f..cb2f90655 100644
--- a/app/Models/Configuration.php
+++ b/app/Models/Configuration.php
@@ -220,19 +220,13 @@ class FreshRSS_Configuration extends Minz_Model {
public function _sortOrder ($value) {
$this->sort_order = $value === 'ASC' ? 'ASC' : 'DESC';
}
- public function _oldEntries ($value) {
- if (ctype_digit ($value) && $value > 0) {
- $this->old_entries = intval($value);
- } else {
- $this->old_entries = 3;
- }
+ public function _oldEntries($value) {
+ $value = intval($value);
+ $this->old_entries = $value > 0 ? $value : 3;
}
public function _keepHistoryDefault($value) {
- if (ctype_digit($value) && $value >= -1) {
- $this->keep_history_default = intval($value);
- } else {
- $this->keep_history_default = 0;
- }
+ $value = intval($value);
+ $this->keep_history_default = $value >= -1 ? $value : 0;
}
public function _shortcuts ($values) {
foreach ($values as $key => $value) {