diff options
author | admin <devnull@localhost> | 2006-09-03 20:24:39 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-09-03 20:24:39 +0200 |
commit | 1cf89aab5fff8c8068cbf0ed18038b6e4fd4f605 (patch) | |
tree | 18ee7e5d935161e64460f55a1ce8ddceb2cbe046 /system/libraries | |
parent | 6ac4bea2da9e64fb0b434f52177353f6bd65b8e6 (diff) |
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Email.php | 4 | ||||
-rw-r--r-- | system/libraries/Image_lib.php | 2 | ||||
-rw-r--r-- | system/libraries/Log.php | 6 | ||||
-rw-r--r-- | system/libraries/Output.php | 2 | ||||
-rw-r--r-- | system/libraries/Pagination.php | 2 | ||||
-rw-r--r-- | system/libraries/Router.php | 14 | ||||
-rw-r--r-- | system/libraries/Session.php | 2 | ||||
-rw-r--r-- | system/libraries/Trackback.php | 4 | ||||
-rw-r--r-- | system/libraries/URI.php | 4 | ||||
-rw-r--r-- | system/libraries/Validation.php | 8 |
10 files changed, 28 insertions, 20 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 96dc0014d..abc77a54d 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -275,7 +275,7 @@ class CI_Email { */ function bcc($bcc, $limit = '') { - if ($limit != '' && ctype_digit($limit)) + if ($limit != '' && is_numeric($limit)) { $this->bcc_batch_mode = true; $this->bcc_batch_size = $limit; @@ -475,7 +475,7 @@ class CI_Email { */ function set_priority($n = 3) { - if ( ! ctype_digit($n)) + if ( ! is_numeric($n)) { $this->priority = 3; return; diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 854f0484b..18e3253f7 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -291,7 +291,7 @@ class CI_Image_lib { // Set the quality $this->quality = trim(str_replace("%", "", $this->quality)); - if ($this->quality == '' OR $this->quality == 0 OR ! ctype_digit($this->quality)) + if ($this->quality == '' OR $this->quality == 0 OR ! is_numeric($this->quality)) $this->quality = 90; // Set the x/y coordinates diff --git a/system/libraries/Log.php b/system/libraries/Log.php index de5a9b836..6c78316f1 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -43,13 +43,13 @@ class CI_Log { function CI_Log($path = '', $threshold = 4, $date_fmt = '') { $this->log_path = ($path != '') ? $path : BASEPATH.'logs/'; - + if ( ! is_dir($this->log_path) OR ! is_writable($this->log_path)) { $this->_enabled = FALSE; } - if (ctype_digit($threshold)) + if (is_numeric($threshold)) { $this->_threshold = $threshold; } @@ -77,7 +77,7 @@ class CI_Log { function write_log($level = 'error', $msg, $php_error = FALSE) { if ($this->_enabled === FALSE) - { + { return FALSE; } diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 73f03863e..7a03cf9c7 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -78,7 +78,7 @@ class CI_Output { */ function cache($time) { - $this->cache_expiration = ( ! ctype_digit($time)) ? 0 : $time; + $this->cache_expiration = ( ! is_numeric($time)) ? 0 : $time; } // -------------------------------------------------------------------- diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 0bbb577a3..9d558f00a 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -128,7 +128,7 @@ class CI_Pagination { $this->cur_page = $obj->uri->segment($this->uri_segment); } - if ( ! ctype_digit($this->cur_page)) + if ( ! is_numeric($this->cur_page)) { $this->cur_page = 0; } diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 2219f5739..1c67113f6 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -219,15 +219,23 @@ class CI_Router { { return $segments; } - + // Is the controller in a sub-folder? if (is_dir(APPPATH.'controllers/'.$segments['0'])) - { + { // Set the directory and remove it from the segment array $this->set_directory($segments['0']); $segments = array_slice($segments, 1); - if (count($segments) == 0) + if (count($segments) > 0) + { + // Does the requested controller exist in the sub-folder? + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments['0'].EXT)) + { + show_404(); + } + } + else { $this->set_class($this->default_controller); $this->set_method('index'); diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 4f08cf692..94efee55c 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -99,7 +99,7 @@ class CI_Session { */ $expiration = $this->object->config->item('sess_expiration'); - if (ctype_digit($expiration)) + if (is_numeric($expiration)) { if ($expiration > 0) { diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index 583c6d28d..8f9680d44 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -368,7 +368,7 @@ class CI_Trackback { $tb_array = explode('/', $url); $tb_end = $tb_array[count($tb_array)-1]; - if ( ! ctype_digit($tb_end)) + if ( ! is_numeric($tb_end)) { $tb_end = $tb_array[count($tb_array)-2]; } @@ -386,7 +386,7 @@ class CI_Trackback { $tb_array = explode('/', $url); $tb_id = $tb_array[count($tb_array)-1]; - if ( ! ctype_digit($tb_id)) + if ( ! is_numeric($tb_id)) { $tb_id = $tb_array[count($tb_array)-2]; } diff --git a/system/libraries/URI.php b/system/libraries/URI.php index c5fd4625b..ba6279e88 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -88,7 +88,7 @@ class CI_URI { */ function uri_to_assoc($n = 3, $default = array()) { - if ( ! ctype_digit($n)) + if ( ! is_numeric($n)) { return $default; } @@ -110,7 +110,7 @@ class CI_URI { { $retval[$val] = FALSE; } - return $default; + return $retval; } $segments = array_slice($this->segment_array(), ($n - 1)); diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index 30faa85ed..44f49ff62 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -404,7 +404,7 @@ class CI_Validation { */ function min_length($str, $val) { - if ( ! ctype_digit($val)) + if ( ! is_numeric($val)) { return FALSE; } @@ -423,7 +423,7 @@ class CI_Validation { */ function max_length($str, $val) { - if ( ! ctype_digit($val)) + if ( ! is_numeric($val)) { return FALSE; } @@ -442,7 +442,7 @@ class CI_Validation { */ function exact_length($str, $val) { - if ( ! ctype_digit($val)) + if ( ! is_numeric($val)) { return FALSE; } @@ -517,7 +517,7 @@ class CI_Validation { */ function numeric($str) { - return ( ! ctype_digit($str)) ? FALSE : TRUE; + return ( ! is_numeric($str)) ? FALSE : TRUE; } // -------------------------------------------------------------------- |