From 9af2ec4d32deb49282587b45d2a02446a6400b19 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 4 Oct 2008 01:47:48 +0000 Subject: removed some ereg() calls for better performance --- system/libraries/Upload.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 42d02d941..3832dab06 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -398,7 +398,7 @@ class CI_Upload { */ function set_max_filesize($n) { - $this->max_size = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + $this->max_size = ((int) $n < 0) ? 0: (int) $n; } // -------------------------------------------------------------------- @@ -412,7 +412,7 @@ class CI_Upload { */ function set_max_filename($n) { - $this->max_filename = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + $this->max_filename = ((int) $n < 0) ? 0: (int) $n; } // -------------------------------------------------------------------- @@ -426,7 +426,7 @@ class CI_Upload { */ function set_max_width($n) { - $this->max_width = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + $this->max_width = ((int) $n < 0) ? 0: (int) $n; } // -------------------------------------------------------------------- @@ -440,7 +440,7 @@ class CI_Upload { */ function set_max_height($n) { - $this->max_height = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + $this->max_height = ((int) $n < 0) ? 0: (int) $n; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b