From 83b05a860a5f208d15942b517385848cfe4887bb Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 25 Sep 2006 21:06:46 +0000 Subject: --- system/libraries/Loader.php | 7 +++++-- system/libraries/Router.php | 20 ++++++++++---------- system/libraries/Validation.php | 16 +++++++++++++++- 3 files changed, 30 insertions(+), 13 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index f4a9f821d..b69d3f049 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -363,7 +363,10 @@ class CI_Loader { * Load Script * * This function loads the specified include file from the - * application/scripts/ folder + * application/scripts/ folder. + * + * NOTE: This feature has been deprecated but it will remain available + * for legacy users. * * @access public * @param array @@ -496,7 +499,7 @@ class CI_Loader { } /* - * Extract and cached variables + * Extract and cache variables * * You can either set variables using the dedicated $this->load_vars() * function or via the second parameter of this function. We'll merge diff --git a/system/libraries/Router.php b/system/libraries/Router.php index d1751a0e9..d7740f5f3 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -149,12 +149,12 @@ class CI_Router { return; } - $this->set_class($segments['0']); + $this->set_class($segments[0]); - if (isset($segments['1'])) + if (isset($segments[1])) { // A scaffolding request. No funny business with the URL - if ($this->routes['scaffolding_trigger'] == $segments['1'] AND $segments['1'] != '_ci_scaffolding') + if ($this->routes['scaffolding_trigger'] == $segments[1] AND $segments[1] != '_ci_scaffolding') { $this->scaffolding_request = TRUE; unset($this->routes['scaffolding_trigger']); @@ -162,7 +162,7 @@ class CI_Router { else { // A standard method request - $this->set_method($segments['1']); + $this->set_method($segments[1]); } } @@ -186,22 +186,22 @@ class CI_Router { function _validate_segments($segments) { // Does the requested controller exist in the root folder? - if (file_exists(APPPATH.'controllers/'.$segments['0'].EXT)) + if (file_exists(APPPATH.'controllers/'.$segments[0].EXT)) { return $segments; } // Is the controller in a sub-folder? - if (is_dir(APPPATH.'controllers/'.$segments['0'])) + if (is_dir(APPPATH.'controllers/'.$segments[0])) { // Set the directory and remove it from the segment array - $this->set_directory($segments['0']); + $this->set_directory($segments[0]); $segments = array_slice($segments, 1); if (count($segments) > 0) { // Does the requested controller exist in the sub-folder? - if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments['0'].EXT)) + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].EXT)) { show_404(); } @@ -250,7 +250,7 @@ class CI_Router { { $this->segments[$i++] = $val; } - unset($this->segments['0']); + unset($this->segments[0]); if ($diff == FALSE) { @@ -263,7 +263,7 @@ class CI_Router { { $this->rsegments[$i++] = $val; } - unset($this->rsegments['0']); + unset($this->rsegments[0]); } } // END _reindex_segments() diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index 153657e31..b65b9be52 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -519,13 +519,27 @@ class CI_Validation { * Numeric * * @access public - * @param string + * @param int * @return bool */ function numeric($str) { return ( ! ereg("^[0-9\.]+$", $str)) ? FALSE : TRUE; } + + // -------------------------------------------------------------------- + + /** + * Is Numeric + * + * @access public + * @param string + * @return bool + */ + function is_numeric($str) + { + return ( ! is_numeric($str)) ? FALSE : TRUE; + } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b