diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/database/DB_driver.php | 9 | ||||
-rw-r--r-- | system/helpers/smiley_helper.php | 2 | ||||
-rw-r--r-- | system/helpers/url_helper.php | 21 | ||||
-rw-r--r-- | system/libraries/Config.php | 2 | ||||
-rw-r--r-- | system/libraries/Exceptions.php | 4 | ||||
-rw-r--r-- | system/libraries/Language.php | 5 | ||||
-rw-r--r-- | system/libraries/Loader.php | 20 | ||||
-rw-r--r-- | system/libraries/Router.php | 2 | ||||
-rw-r--r-- | system/libraries/Table.php | 2 |
9 files changed, 32 insertions, 35 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 49ac8ab24..77069d1a8 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -372,8 +372,8 @@ class CI_DB_driver { if ( ! class_exists($driver)) { - include_once(BASEPATH.'database/DB_result'.EXT); - include_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result'.EXT); + include(BASEPATH.'database/DB_result'.EXT); + include(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result'.EXT); } return $driver; @@ -998,7 +998,7 @@ class CI_DB_driver { return TRUE; } - if ( ! @include_once(BASEPATH.'database/DB_cache'.EXT)) + if ( ! @include(BASEPATH.'database/DB_cache'.EXT)) { return $this->cache_off(); } @@ -1054,13 +1054,12 @@ class CI_DB_driver { if ( ! class_exists('CI_Exceptions')) { - include_once(BASEPATH.'libraries/Exceptions'.EXT); + include(BASEPATH.'libraries/Exceptions'.EXT); } $error = new CI_Exceptions(); echo $error->show_error('An Error Was Encountered', $message, 'error_db'); exit; - } } diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index 0f426d609..a07337246 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -149,7 +149,7 @@ function _get_smiley_array() return FALSE; } - include_once(APPPATH.'config/smileys'.EXT); + include(APPPATH.'config/smileys'.EXT); if ( ! isset($smileys) OR ! is_array($smileys)) { diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index cd628c6ae..9010a06a3 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -110,10 +110,7 @@ function anchor($uri = '', $title = '', $attributes = '') } else { - if (is_array($attributes)) - { - $attributes = parse_url_attributes($attributes); - } + $attributes = _parse_attributes($attributes); } return '<a href="'.$site_url.'"'.$attributes.'>'.$title.'</a>'; @@ -157,7 +154,7 @@ function anchor_popup($uri = '', $title = '', $attributes = FALSE) $atts[$key] = ( ! isset($attributes[$key])) ? $val : $attributes[$key]; } - return "<a href='javascript:void(0);' onclick=\"window.open('".$site_url."', '_blank', '".parse_url_attributes($atts, TRUE)."');\">".$title."</a>"; + return "<a href='javascript:void(0);' onclick=\"window.open('".$site_url."', '_blank', '"._parse_attributes($atts, TRUE)."');\">".$title."</a>"; } // ------------------------------------------------------------------------ @@ -178,10 +175,7 @@ function mailto($email, $title = '', $attributes = '') $title = $email; } - if (is_array($attributes)) - { - $attributes = parse_url_attributes($attributes); - } + $attributes = _parse_attributes($attributes); return '<a href="mailto:'.$email.'"'.$attributes.'>'.$title.'</a>'; } @@ -468,8 +462,13 @@ function redirect($uri = '', $method = 'location') * @param bool * @return string */ -function parse_url_attributes($attributes, $javascript = FALSE) +function _parse_attributes($attributes, $javascript = FALSE) { + if (is_string($attributes)) + { + return ($attributes != '') ? ' '.$attributes : ''; + } + $att = ''; foreach ($attributes as $key => $val) { @@ -483,7 +482,7 @@ function parse_url_attributes($attributes, $javascript = FALSE) } } - if ($javascript == TRUE) + if ($javascript == TRUE AND $att != '') { $att = substr($att, 0, -1); } diff --git a/system/libraries/Config.php b/system/libraries/Config.php index aa26c9203..c4ea9b4ee 100644 --- a/system/libraries/Config.php +++ b/system/libraries/Config.php @@ -75,7 +75,7 @@ class CI_Config { show_error('The configuration file '.$file.EXT.' does not exist.'); } - include_once(APPPATH.'config/'.$file.EXT); + include(APPPATH.'config/'.$file.EXT); if ( ! isset($config) OR ! is_array($config)) { diff --git a/system/libraries/Exceptions.php b/system/libraries/Exceptions.php index 6d58ee6b9..8f90ff8f9 100644 --- a/system/libraries/Exceptions.php +++ b/system/libraries/Exceptions.php @@ -120,7 +120,7 @@ class CI_Exceptions { ob_end_flush(); } ob_start(); - include_once(APPPATH.'errors/'.$template.EXT); + include(APPPATH.'errors/'.$template.EXT); $buffer = ob_get_contents(); ob_end_clean(); return $buffer; @@ -156,7 +156,7 @@ class CI_Exceptions { ob_end_flush(); } ob_start(); - include_once(APPPATH.'errors/error_php'.EXT); + include(APPPATH.'errors/error_php'.EXT); $buffer = ob_get_contents(); ob_end_clean(); echo $buffer; diff --git a/system/libraries/Language.php b/system/libraries/Language.php index 37a5c7e99..faf516ea5 100644 --- a/system/libraries/Language.php +++ b/system/libraries/Language.php @@ -66,16 +66,15 @@ class CI_Language { } // Determine where the language file is and load it - if (file_exists(APPPATH.'language/'.$idiom.'/'.$langfile)) { - include_once(APPPATH.'language/'.$idiom.'/'.$langfile); + include(APPPATH.'language/'.$idiom.'/'.$langfile); } else { if (file_exists(BASEPATH.'language/'.$idiom.'/'.$langfile)) { - include_once(BASEPATH.'language/'.$idiom.'/'.$langfile); + include(BASEPATH.'language/'.$idiom.'/'.$langfile); } else { diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index f243a2879..709d9fe3d 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -315,13 +315,13 @@ class CI_Loader { if (file_exists(APPPATH.'helpers/'.$helper.EXT)) { - include_once(APPPATH.'helpers/'.$helper.EXT); + include(APPPATH.'helpers/'.$helper.EXT); } else { if (file_exists(BASEPATH.'helpers/'.$helper.EXT)) { - include_once(BASEPATH.'helpers/'.$helper.EXT); + include(BASEPATH.'helpers/'.$helper.EXT); } else { @@ -381,13 +381,13 @@ class CI_Loader { if (file_exists(APPPATH.'plugins/'.$plugin.EXT)) { - include_once(APPPATH.'plugins/'.$plugin.EXT); + include(APPPATH.'plugins/'.$plugin.EXT); } else { if (file_exists(BASEPATH.'plugins/'.$plugin.EXT)) { - include_once(BASEPATH.'plugins/'.$plugin.EXT); + include(BASEPATH.'plugins/'.$plugin.EXT); } else { @@ -454,7 +454,7 @@ class CI_Loader { show_error('Unable to load the requested script: scripts/'.$script.EXT); } - include_once(APPPATH.'scripts/'.$script.EXT); + include(APPPATH.'scripts/'.$script.EXT); $this->_ci_scripts[$script] = TRUE; } @@ -675,8 +675,8 @@ class CI_Loader { show_error("Unable to load the requested class: ".$class); } - include_once(BASEPATH.'libraries/'.ucfirst($class).EXT); - include_once(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT); + include(BASEPATH.'libraries/'.ucfirst($class).EXT); + include(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT); return $this->_ci_init_class($class, config_item('subclass_prefix'), $params); } @@ -687,7 +687,7 @@ class CI_Loader { $path = ($i % 2) ? APPPATH : BASEPATH; if (file_exists($path.'libraries/'.$class.EXT)) { - include_once($path.'libraries/'.$class.EXT); + include($path.'libraries/'.$class.EXT); return $this->_ci_init_class($class, '', $params); } } @@ -715,7 +715,7 @@ class CI_Loader { $config = NULL; if (file_exists(APPPATH.'config/'.$class.EXT)) { - include_once(APPPATH.'config/'.$class.EXT); + include(APPPATH.'config/'.$class.EXT); } } @@ -758,7 +758,7 @@ class CI_Loader { */ function _ci_autoloader() { - include_once(APPPATH.'config/autoload'.EXT); + include(APPPATH.'config/autoload'.EXT); if ( ! isset($autoload)) { diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 886433f37..6d925a1c0 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -81,7 +81,7 @@ class CI_Router { } // Load the routes.php file. - @include_once(APPPATH.'config/routes'.EXT); + @include(APPPATH.'config/routes'.EXT); $this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route; unset($route); diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 183e8895a..1b25a441a 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -268,7 +268,7 @@ class CI_Table { * @access public * @return void */ - function clear_data() + function clear() { $this->rows = array(); $this->heading = array(); |