Fixes variable use.
[platal.git] / classes / pldict.php
index b67095a..08d45ad 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2010 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -79,8 +79,8 @@ class PlDict
 
     public function i($key, $default = 0)
     {
-        $i = $this->_get($key, $default);
-        return (is_int($i) || ctype_digit($i)) ? intval($i) : $default;
+        $i = to_integer($this->_get($key, $default));
+        return $i === false ? $default : $i;
     }
 
     public function l(array $keys)