From 12f9cc8fc102389bd232f35921b4bd6c4daa9c31 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 22 Jan 2008 07:21:32 +0000 Subject: Changed "numeric" to use is_numeric() and added an "integer" rule into the Validation library. --- system/libraries/Validation.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'system/libraries/Validation.php') 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; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b