From 993925b47a0bfb08e79961c47bcc3d247a03a5dd Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 21 Aug 2008 12:43:31 +0000 Subject: whitespace fixes a minor re-ordering of the changelog --- system/application/config/config.php | 2 +- system/application/config/constants.php | 2 +- system/application/config/user_agents.php | 6 +- system/codeigniter/Common.php | 10 +- system/database/DB.php | 3 +- system/database/DB_driver.php | 24 ++-- system/database/DB_result.php | 2 +- system/database/drivers/mysql/mysql_driver.php | 18 +-- system/database/drivers/oci8/oci8_result.php | 10 +- system/helpers/file_helper.php | 104 ++++++++-------- system/helpers/form_helper.php | 12 +- system/helpers/inflector_helper.php | 84 ++++++------- system/helpers/smiley_helper.php | 34 +++--- system/helpers/string_helper.php | 4 +- system/libraries/Controller.php | 12 +- system/libraries/Email.php | 6 +- system/libraries/Session.php | 158 ++++++++++++------------- system/libraries/Upload.php | 2 +- system/libraries/Validation.php | 22 ++-- system/libraries/Zip.php | 30 ++--- 20 files changed, 273 insertions(+), 272 deletions(-) (limited to 'system') diff --git a/system/application/config/config.php b/system/application/config/config.php index f8fd9c809..da7979788 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -149,7 +149,7 @@ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; | */ $config['enable_query_strings'] = FALSE; -$config['directory_trigger'] = 'd'; // experimental not currently in use +$config['directory_trigger'] = 'd'; // experimental not currently in use $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; diff --git a/system/application/config/constants.php b/system/application/config/constants.php index 55dc6b777..3d317f58e 100644 --- a/system/application/config/constants.php +++ b/system/application/config/constants.php @@ -29,7 +29,7 @@ define('DIR_WRITE_MODE', 0777); define('FOPEN_READ', 'rb'); define('FOPEN_READ_WRITE', 'r+b'); -define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care +define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care define('FOPEN_WRITE_CREATE', 'ab'); define('FOPEN_READ_WRITE_CREATE', 'a+b'); diff --git a/system/application/config/user_agents.php b/system/application/config/user_agents.php index d350af3aa..38bfc1f72 100644 --- a/system/application/config/user_agents.php +++ b/system/application/config/user_agents.php @@ -163,12 +163,12 @@ $mobiles = array( $robots = array( 'googlebot' => 'Googlebot', 'msnbot' => 'MSNBot', - 'slurp' => 'Inktomi Slurp', - 'yahoo' => 'Yahoo', + 'slurp' => 'Inktomi Slurp', + 'yahoo' => 'Yahoo', 'askjeeves' => 'AskJeeves', 'fastcrawler' => 'FastCrawler', 'infoseek' => 'InfoSeek Robot 1.0', - 'lycos' => 'Lycos' + 'lycos' => 'Lycos' ); /* End of file user_agents.php */ diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index b0df52921..8f4f9a941 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -93,16 +93,16 @@ function &load_class($class, $instantiate = TRUE) // folder we'll load the native class from the system/libraries folder. if (file_exists(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT)) { - require(BASEPATH.'libraries/'.$class.EXT); + require(BASEPATH.'libraries/'.$class.EXT); require(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT); - $is_subclass = TRUE; + $is_subclass = TRUE; } else { if (file_exists(APPPATH.'libraries/'.$class.EXT)) { - require(APPPATH.'libraries/'.$class.EXT); - $is_subclass = FALSE; + require(APPPATH.'libraries/'.$class.EXT); + $is_subclass = FALSE; } else { @@ -241,7 +241,7 @@ function log_message($level = 'error', $message, $php_error = FALSE) return; } - $LOG =& load_class('Log'); + $LOG =& load_class('Log'); $LOG->write_log($level, $message, $php_error); } diff --git a/system/database/DB.php b/system/database/DB.php index eb25273a1..ef67c80c8 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -44,8 +44,7 @@ function &DB($params = '', $active_record_override = FALSE) show_error('You have specified an invalid database connection group.'); } - $params = $db[$active_group]; - } + $params = $db[$active_group] } elseif (is_string($params)) { diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 60f51d757..1678cffd5 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -142,7 +142,7 @@ class CI_DB_driver { { $this->display_error('db_unable_to_create', $this->database); } - return FALSE; + return FALSE; } else { @@ -221,7 +221,7 @@ class CI_DB_driver { { return $this->display_error('db_unsupported_function'); } - return FALSE; + return FALSE; } if ($this->dbdriver == 'oci8') @@ -258,7 +258,7 @@ class CI_DB_driver { log_message('error', 'Invalid query: '.$sql); return $this->display_error('db_invalid_query'); } - return FALSE; + return FALSE; } // Verify table prefix and replace if necessary @@ -543,12 +543,12 @@ class CI_DB_driver { $this->_trans_status = TRUE; } - log_message('debug', 'DB Transaction Failure'); - return FALSE; + log_message('debug', 'DB Transaction Failure'); + return FALSE; } $this->trans_commit(); - return TRUE; + return TRUE; } // -------------------------------------------------------------------- @@ -755,7 +755,7 @@ class CI_DB_driver { { return $this->display_error('db_unsupported_function'); } - return FALSE; + return FALSE; } $retval = array(); @@ -815,7 +815,7 @@ class CI_DB_driver { { return $this->display_error('db_field_param_missing'); } - return FALSE; + return FALSE; } if (FALSE === ($sql = $this->_list_columns($this->prep_tablename($table)))) @@ -824,7 +824,7 @@ class CI_DB_driver { { return $this->display_error('db_unsupported_function'); } - return FALSE; + return FALSE; } $query = $this->query($sql); @@ -887,7 +887,7 @@ class CI_DB_driver { { return $this->display_error('db_field_param_missing'); } - return FALSE; + return FALSE; } $query = $this->query($this->_field_data($this->prep_tablename($table))); @@ -906,7 +906,7 @@ class CI_DB_driver { */ function insert_string($table, $data) { - $fields = array(); + $fields = array(); $values = array(); foreach($data as $key => $val) @@ -1039,7 +1039,7 @@ class CI_DB_driver { { return $this->display_error('db_unsupported_function'); } - return FALSE; + return FALSE; } else { diff --git a/system/database/DB_result.php b/system/database/DB_result.php index d8d0d0d97..2a7824ff5 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -104,7 +104,7 @@ class CI_DB_result { return array(); } - $this->_data_seek(0); + $this->_data_seek(0); while ($row = $this->_fetch_assoc()) { $this->result_array[] = $row; diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 8df6c1b70..889ea17fb 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -246,15 +246,15 @@ class CI_DB_mysql_driver extends CI_DB { function escape_str($str) { if (is_array($str)) - { - foreach($str as $key => $val) - { - $str[$key] = $this->escape_str($val); - } - - return $str; - } - + { + foreach($str as $key => $val) + { + $str[$key] = $this->escape_str($val); + } + + return $str; + } + if (function_exists('mysql_real_escape_string') AND is_resource($this->conn_id)) { return mysql_real_escape_string($str, $this->conn_id); diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index 73373c882..20ab925fd 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -42,13 +42,15 @@ class CI_DB_oci8_result extends CI_DB_result { */ function num_rows() { - $rowcount = count($this->result_array()); - @ociexecute($this->stmt_id); - if ($this->curs_id) + $rowcount = count($this->result_array()); + @ociexecute($this->stmt_id); + + if ($this->curs_id) { @ociexecute($this->curs_id); } - return $rowcount; + + return $rowcount; } // -------------------------------------------------------------------- diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 86c5c09db..b59443c0e 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -262,60 +262,60 @@ if ( ! function_exists('get_dir_file_info')) * Options are: name, server_path, size, date, readable, writable, executable, fileperms * Returns FALSE if the file cannot be found. * -* @access public -* @param string path to file -* @param mixed array or comma separated string of information returned -* @return array -*/ +* @access public +* @param string path to file +* @param mixed array or comma separated string of information returned +* @return array +*/ if ( ! function_exists('get_file_info')) { - function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date')) - { - - if ( ! file_exists($file)) - { - return FALSE; - } - - if (is_string($returned_values)) - { - $returned_values = explode(',', $returned_values); - } - - foreach ($returned_values as $key) - { - switch ($key) - { - case 'name': - $fileinfo['name'] = substr(strrchr($file, '/'), 1); - break; - case 'server_path': - $fileinfo['server_path'] = $file; - break; - case 'size': - $fileinfo['size'] = filesize($file); - break; - case 'date': - $fileinfo['date'] = filectime($file); - break; - case 'readable': - $fileinfo['readable'] = is_readable($file); - break; - case 'writable': - // There are known problems using is_weritable on IIS. It may not be reliable - consider fileperms() - $fileinfo['writable'] = is_writable($file); - break; - case 'executable': - $fileinfo['executable'] = is_executable($file); - break; - case 'fileperms': - $fileinfo['fileperms'] = fileperms($file); - break; - } - } - - return $fileinfo; - } + function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date')) + { + + if ( ! file_exists($file)) + { + return FALSE; + } + + if (is_string($returned_values)) + { + $returned_values = explode(',', $returned_values); + } + + foreach ($returned_values as $key) + { + switch ($key) + { + case 'name': + $fileinfo['name'] = substr(strrchr($file, '/'), 1); + break; + case 'server_path': + $fileinfo['server_path'] = $file; + break; + case 'size': + $fileinfo['size'] = filesize($file); + break; + case 'date': + $fileinfo['date'] = filectime($file); + break; + case 'readable': + $fileinfo['readable'] = is_readable($file); + break; + case 'writable': + // There are known problems using is_weritable on IIS. It may not be reliable - consider fileperms() + $fileinfo['writable'] = is_writable($file); + break; + case 'executable': + $fileinfo['executable'] = is_executable($file); + break; + case 'fileperms': + $fileinfo['fileperms'] = fileperms($file); + break; + } + } + + return $fileinfo; + } } // -------------------------------------------------------------------- diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 0ad57d532..0c74ac0ff 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -53,7 +53,7 @@ if ( ! function_exists('form_open')) $form = '
(( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); - if ( ! is_array($data) OR ! isset($data['value'])) + if ( ! is_array($data) OR ! isset($data['value'])) { $val = $value; } - else + else { $val = $data['value']; unset($data['value']); // textareas don't use the value attribute @@ -466,7 +466,7 @@ if ( ! function_exists('form_fieldset')) { $fieldset = " 0) diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index 49ba542a1..e362a3fd7 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -41,28 +41,28 @@ if ( ! function_exists('singular')) { function singular($str) { - $str = strtolower(trim($str)); - $end = substr($str, -3); - - if ($end == 'ies') - { - $str = substr($str, 0, strlen($str)-3).'y'; - } - elseif ($end == 'ses') - { - $str = substr($str, 0, strlen($str)-2); - } - else - { - $end = substr($str, -1); - - if ($end == 's') - { - $str = substr($str, 0, strlen($str)-1); - } - } - - return $str; + $str = strtolower(trim($str)); + $end = substr($str, -3); + + if ($end == 'ies') + { + $str = substr($str, 0, strlen($str)-3).'y'; + } + elseif ($end == 'ses') + { + $str = substr($str, 0, strlen($str)-2); + } + else + { + $end = substr($str, -1); + + if ($end == 's') + { + $str = substr($str, 0, strlen($str)-1); + } + } + + return $str; } } @@ -82,26 +82,26 @@ if ( ! function_exists('plural')) { function plural($str, $force = FALSE) { - $str = strtolower(trim($str)); - $end = substr($str, -1); - - if ($end == 'y') - { - $str = substr($str, 0, strlen($str)-1).'ies'; - } - elseif ($end == 's') - { - if ($force == TRUE) - { - $str .= 'es'; - } - } - else - { - $str .= 's'; - } - - return $str; + $str = strtolower(trim($str)); + $end = substr($str, -1); + + if ($end == 'y') + { + $str = substr($str, 0, strlen($str)-1).'ies'; + } + elseif ($end == 's') + { + if ($force == TRUE) + { + $str .= 'es'; + } + } + else + { + $str .= 's'; + } + + return $str; } } diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index 8f7543746..efa338467 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -36,7 +36,7 @@ * @param string form name * @param string field name * @return string - */ + */ if ( ! function_exists('js_insert_smiley')) { function js_insert_smiley($form_name = '', $form_field = '') @@ -49,7 +49,7 @@ if ( ! function_exists('js_insert_smiley')) } EOF; - } + } } // ------------------------------------------------------------------------ @@ -62,7 +62,7 @@ EOF; * @access public * @param string the URL to the folder containing the smiley images * @return array - */ + */ if ( ! function_exists('get_clickable_smileys')) { function get_clickable_smileys($image_url = '', $smileys = NULL) @@ -72,12 +72,12 @@ if ( ! function_exists('get_clickable_smileys')) if (FALSE === ($smileys = _get_smiley_array())) { return $smileys; - } + } } // Add a trailing slash to the file path if needed $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); - + $used = array(); foreach ($smileys as $key => $val) { @@ -89,12 +89,12 @@ if ( ! function_exists('get_clickable_smileys')) { continue; } - - $link[] = "\"".$smileys[$key][3]."\""; - + + $link[] = "\"".$smileys[$key][3]."\""; + $used[$smileys[$key][0]] = TRUE; } - + return $link; } } @@ -110,7 +110,7 @@ if ( ! function_exists('get_clickable_smileys')) * @param string the text to be parsed * @param string the URL to the folder containing the smiley images * @return string - */ + */ if ( ! function_exists('parse_smileys')) { function parse_smileys($str = '', $image_url = '', $smileys = NULL) @@ -125,17 +125,17 @@ if ( ! function_exists('parse_smileys')) if (FALSE === ($smileys = _get_smiley_array())) { return $str; - } + } } - + // Add a trailing slash to the file path if needed $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); foreach ($smileys as $key => $val) - { + { $str = str_replace($key, "\"".$smileys[$key][3]."\"", $str); } - + return $str; } } @@ -149,7 +149,7 @@ if ( ! function_exists('parse_smileys')) * * @access private * @return mixed - */ + */ if ( ! function_exists('_get_smiley_array')) { function _get_smiley_array() @@ -160,12 +160,12 @@ if ( ! function_exists('_get_smiley_array')) } include(APPPATH.'config/smileys'.EXT); - + if ( ! isset($smileys) OR ! is_array($smileys)) { return FALSE; } - + return $smileys; } } diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 7b6becffe..d85d76ca4 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -46,7 +46,7 @@ if ( ! function_exists('trim_slashes')) { function trim_slashes($str) { - return trim($str, '/'); + return trim($str, '/'); } } @@ -173,7 +173,7 @@ if ( ! function_exists('reduce_multiples')) { $str = trim($str, $character); } - + return $str; } } diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 5c96c577a..f9c6bd270 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -87,12 +87,12 @@ class Controller extends CI_Base { // sync up the objects since PHP4 was working from a copy foreach (array_keys(get_object_vars($this)) as $attribute) - { - if (is_object($this->$attribute)) - { - $this->load->$attribute =& $this->$attribute; - } - } + { + if (is_object($this->$attribute)) + { + $this->load->$attribute =& $this->$attribute; + } + } } } diff --git a/system/libraries/Email.php b/system/libraries/Email.php index b0d9f1269..ca1093a9b 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1169,7 +1169,7 @@ class CI_Email { // Standardize newlines if (strpos($str, "\r") !== FALSE) { - $str = str_replace(array("\r\n", "\r"), "\n", $str); + $str = str_replace(array("\r\n", "\r"), "\n", $str); } // We are intentionally wrapping so mail servers will encode characters @@ -1179,8 +1179,8 @@ class CI_Email { // Break into an array of lines $lines = explode("\n", $str); - $escape = '='; - $output = ''; + $escape = '='; + $output = ''; foreach ($lines as $line) { diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 9907ade47..9fad08cf9 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -69,10 +69,10 @@ class CI_Session { $this->CI->load->helper('string'); // Do we need encryption? If so, load the encryption class - if ($this->sess_encrypt_cookie == TRUE) + if ($this->sess_encrypt_cookie == TRUE) { $this->CI->load->library('encrypt'); - } + } // Are we using a database? If so, load it if ($this->sess_use_database === TRUE AND $this->sess_table_name != '') @@ -106,10 +106,10 @@ class CI_Session { } // Delete 'old' flashdata (from last request) - $this->_flashdata_sweep(); - - // Mark all new flashdata as old (data will be deleted before next request) - $this->_flashdata_mark(); + $this->_flashdata_sweep(); + + // Mark all new flashdata as old (data will be deleted before next request) + $this->_flashdata_mark(); // Delete expired sessions if necessary $this->_sess_gc(); @@ -361,7 +361,7 @@ class CI_Session { // Turn it into a hash $new_sessid = md5(uniqid($new_sessid, TRUE)); - // Update the session data in the session data array + // Update the session data in the session data array $this->userdata['session_id'] = $new_sessid; $this->userdata['last_activity'] = $this->now; @@ -427,7 +427,7 @@ class CI_Session { */ function all_userdata() { - return ( ! isset($this->userdata)) ? FALSE : $this->userdata; + return ( ! isset($this->userdata)) ? FALSE : $this->userdata; } // -------------------------------------------------------------------- @@ -484,9 +484,9 @@ class CI_Session { $this->sess_write(); } - // ------------------------------------------------------------------------ + // ------------------------------------------------------------------------ - /** + /** * Add or change flashdata, only available * until the next request * @@ -495,46 +495,46 @@ class CI_Session { * @param string * @return void */ - function set_flashdata($newdata = array(), $newval = '') - { - if (is_string($newdata)) - { - $newdata = array($newdata => $newval); - } - - if (count($newdata) > 0) - { - foreach ($newdata as $key => $val) - { - $flashdata_key = $this->flashdata_key.':new:'.$key; - $this->set_userdata($flashdata_key, $val); - } - } - } - - // ------------------------------------------------------------------------ - - /** - * Keeps existing flashdata available to next request. + function set_flashdata($newdata = array(), $newval = '') + { + if (is_string($newdata)) + { + $newdata = array($newdata => $newval); + } + + if (count($newdata) > 0) + { + foreach ($newdata as $key => $val) + { + $flashdata_key = $this->flashdata_key.':new:'.$key; + $this->set_userdata($flashdata_key, $val); + } + } + } + + // ------------------------------------------------------------------------ + + /** + * Keeps existing flashdata available to next request. * * @access public * @param string * @return void - */ - function keep_flashdata($key) - { + */ + function keep_flashdata($key) + { // 'old' flashdata gets removed. Here we mark all // flashdata as 'new' to preserve it from _flashdata_sweep() // Note the function will return FALSE if the $key // provided cannot be found - $old_flashdata_key = $this->flashdata_key.':old:'.$key; - $value = $this->userdata($old_flashdata_key); + $old_flashdata_key = $this->flashdata_key.':old:'.$key; + $value = $this->userdata($old_flashdata_key); - $new_flashdata_key = $this->flashdata_key.':new:'.$key; - $this->set_userdata($new_flashdata_key, $value); - } + $new_flashdata_key = $this->flashdata_key.':new:'.$key; + $this->set_userdata($new_flashdata_key, $value); + } - // ------------------------------------------------------------------------ + // ------------------------------------------------------------------------ /** * Fetch a specific flashdata item from the session array @@ -543,57 +543,57 @@ class CI_Session { * @param string * @return string */ - function flashdata($key) - { - $flashdata_key = $this->flashdata_key.':old:'.$key; - return $this->userdata($flashdata_key); - } + function flashdata($key) + { + $flashdata_key = $this->flashdata_key.':old:'.$key; + return $this->userdata($flashdata_key); + } - // ------------------------------------------------------------------------ + // ------------------------------------------------------------------------ - /** - * Identifies flashdata as 'old' for removal + /** + * Identifies flashdata as 'old' for removal * when _flashdata_sweep() runs. * * @access private * @return void - */ - function _flashdata_mark() - { + */ + function _flashdata_mark() + { $userdata = $this->all_userdata(); - foreach ($userdata as $name => $value) - { - $parts = explode(':new:', $name); - if (is_array($parts) && count($parts) === 2) - { - $new_name = $this->flashdata_key.':old:'.$parts[1]; - $this->set_userdata($new_name, $value); - $this->unset_userdata($name); - } - } - } - - // ------------------------------------------------------------------------ - - /** - * Removes all flashdata marked as 'old' + foreach ($userdata as $name => $value) + { + $parts = explode(':new:', $name); + if (is_array($parts) && count($parts) === 2) + { + $new_name = $this->flashdata_key.':old:'.$parts[1]; + $this->set_userdata($new_name, $value); + $this->unset_userdata($name); + } + } + } + + // ------------------------------------------------------------------------ + + /** + * Removes all flashdata marked as 'old' * * @access private * @return void - */ + */ - function _flashdata_sweep() - { + function _flashdata_sweep() + { $userdata = $this->all_userdata(); - foreach ($userdata as $key => $value) - { - if (strpos($key, ':old:')) - { - $this->unset_userdata($key); - } - } - - } + foreach ($userdata as $key => $value) + { + if (strpos($key, ':old:')) + { + $this->unset_userdata($key); + } + } + + } // -------------------------------------------------------------------- diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 25e143567..4a615352e 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -836,7 +836,7 @@ class CI_Upload { * Prep Filename * * Prevents possible script execution from Apache's handling of files multiple extensions - * http://httpd.apache.org/docs/1.3/mod/mod_mime.html#multipleext + * http://httpd.apache.org/docs/1.3/mod/mod_mime.html#multipleext * * @access private * @param string diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index cae1a3f5a..b42d0e06d 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -640,17 +640,17 @@ class CI_Validation { */ function is_natural_no_zero($str) { - if ( ! preg_match( '/^[0-9]+$/', $str)) - { - return FALSE; - } - - if ($str == 0) - { - return FALSE; - } - - return TRUE; + if ( ! preg_match( '/^[0-9]+$/', $str)) + { + return FALSE; + } + + if ($str == 0) + { + return FALSE; + } + + return TRUE; } // -------------------------------------------------------------------- diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 8958b572c..6ca9cfb50 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -34,8 +34,8 @@ class CI_Zip { var $zipdata = ''; var $directory = ''; - var $entries = 0; - var $file_num = 0; + var $entries = 0; + var $file_num = 0; var $offset = 0; function CI_Zip() @@ -320,16 +320,16 @@ class CI_Zip { */ function download($filename = 'backup.zip') { - if ( ! preg_match("|.+?\.zip$|", $filename)) - { - $filename .= '.zip'; - } + if ( ! preg_match("|.+?\.zip$|", $filename)) + { + $filename .= '.zip'; + } + + $zip_content =& $this->get_zip(); - $zip_content =& $this->get_zip(); + $CI =& get_instance(); + $CI->load->helper('download'); - $CI =& get_instance(); - $CI->load->helper('download'); - force_download($filename, $zip_content); } @@ -346,11 +346,11 @@ class CI_Zip { */ function clear_data() { - $this->zipdata = ''; - $this->directory = ''; - $this->entries = 0; - $this->file_num = 0; - $this->offset = 0; + $this->zipdata = ''; + $this->directory = ''; + $this->entries = 0; + $this->file_num = 0; + $this->offset = 0; } } -- cgit v1.2.3-24-g4f1b