diff options
author | Derek Allard <derek.allard@ellislab.com> | 2008-01-22 08:21:32 +0100 |
---|---|---|
committer | Derek Allard <derek.allard@ellislab.com> | 2008-01-22 08:21:32 +0100 |
commit | 12f9cc8fc102389bd232f35921b4bd6c4daa9c31 (patch) | |
tree | 853a9769a6a15be397032a4844aa03c0326463e4 /system/libraries | |
parent | da9ee1a658d03c4dbfc64d658e3ab5205550e3c7 (diff) |
Changed "numeric" to use is_numeric() and added an "integer" rule into the Validation library.
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Validation.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index d96b4f6f6..dc4e016bc 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -7,8 +7,8 @@ * @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2006, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
- * @link http://codeigniter.com
+ * @license http://www.codeigniter.com/user_guide/license.html
+ * @link http://www.codeigniter.com
* @since Version 1.0
* @filesource
*/
@@ -22,7 +22,7 @@ * @subpackage Libraries
* @category Validation
* @author ExpressionEngine Dev Team
- * @link http://codeigniter.com/user_guide/libraries/validation.html
+ * @link http://www.codeigniter.com/user_guide/libraries/validation.html
*/
class CI_Validation {
@@ -552,21 +552,21 @@ class CI_Validation { */
function numeric($str)
{
- return ! preg_match('/[^0-9]/', $str);
+ return ( ! is_numeric($str)) ? FALSE : TRUE;
}
// --------------------------------------------------------------------
/**
- * Is Numeric
+ * Integer
*
* @access public
* @param string
* @return bool
*/
- function is_numeric($str)
+ function integer($str)
{
- return ( ! is_numeric($str)) ? FALSE : TRUE;
+ return ( ! is_int($str)) ? FALSE : TRUE;
}
// --------------------------------------------------------------------
|