Revert/optimize some changes from ed944a3c70a0bad158cd5a6ca5ce1f2e717aff5d
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php
index 182f17a..b3e984d 100755
--- a/system/core/CodeIgniter.php
+++ b/system/core/CodeIgniter.php
@@ -94,7 +94,7 @@
* Note: Since the config file data is cached it doesn't
* hurt to load it here.
*/
- if (isset($assign_to_config['subclass_prefix']) && $assign_to_config['subclass_prefix'] !== '')
+ if ( ! empty($assign_to_config['subclass_prefix']))
{
get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix']));
}
diff --git a/system/core/Common.php b/system/core/Common.php
index a773c4f..8af7d63 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -436,12 +436,11 @@
505 => 'HTTP Version Not Supported'
);
- if ($code === '' OR ! is_numeric($code))
+ if ($code == '' OR ! is_numeric($code))
{
show_error('Status codes must be numeric', 500);
}
-
- if (isset($stati[$code]) && $text === '')
+ elseif (isset($stati[$code]) && $text === '')
{
$text = $stati[$code];
}
diff --git a/system/core/Config.php b/system/core/Config.php
index 0e5fa52..3de1bcb 100755
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -189,7 +189,7 @@
*/
public function item($item, $index = '')
{
- if ($index === '')
+ if ($index == '')
{
return isset($this->config[$item]) ? $this->config[$item] : FALSE;
}
diff --git a/system/core/Input.php b/system/core/Input.php
index 284b156..73f46ba 100755
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -267,18 +267,22 @@
{
$prefix = config_item('cookie_prefix');
}
- if ($domain === '' && config_item('cookie_domain') !== '')
+
+ if ($domain == '' && config_item('cookie_domain') != '')
{
$domain = config_item('cookie_domain');
}
+
if ($path === '/' && config_item('cookie_path') !== '/')
{
$path = config_item('cookie_path');
}
+
if ($secure === FALSE && config_item('cookie_secure') !== FALSE)
{
$secure = config_item('cookie_secure');
}
+
if ($httponly === FALSE && config_item('cookie_httponly') !== FALSE)
{
$httponly = config_item('cookie_httponly');
@@ -324,7 +328,7 @@
return $this->ip_address;
}
- if (config_item('proxy_ips') !== '' && $this->server('HTTP_X_FORWARDED_FOR') && $this->server('REMOTE_ADDR'))
+ if (config_item('proxy_ips') != '' && $this->server('HTTP_X_FORWARDED_FOR') && $this->server('REMOTE_ADDR'))
{
$proxies = preg_split('/[\s,]/', config_item('proxy_ips'), -1, PREG_SPLIT_NO_EMPTY);
$proxies = is_array($proxies) ? $proxies : array($proxies);
diff --git a/system/core/Output.php b/system/core/Output.php
index 496948a..9b85b3e 100755
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -101,7 +101,7 @@
*/
public function __construct()
{
- $this->_zlib_oc = @ini_get('zlib.output_compression');
+ $this->_zlib_oc = (bool) @ini_get('zlib.output_compression');
// Get mime types for later
if (defined('ENVIRONMENT') && file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
@@ -160,7 +160,7 @@
*/
public function append_output($output)
{
- if ($this->final_output === '')
+ if ($this->final_output == '')
{
$this->final_output = $output;
}
@@ -505,7 +505,7 @@
*
* @param object config class
* @param object uri class
- * @return void
+ * @return bool
*/
public function _display_cache(&$CFG, &$URI)
{
diff --git a/system/core/Router.php b/system/core/Router.php
index 93875bd..5bc0530 100755
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -165,7 +165,7 @@
$this->uri->_fetch_uri_string();
// Is there a URI string? If not, the default controller specified in the "routes" file will be shown.
- if ($this->uri->uri_string === '')
+ if ($this->uri->uri_string == '')
{
return $this->_set_default_controller();
}
@@ -483,14 +483,14 @@
$this->set_directory($routing['directory']);
}
- if (isset($routing['controller']) && $routing['controller'] !== '')
+ if ( ! empty($routing['controller']))
{
$this->set_class($routing['controller']);
}
if (isset($routing['function']))
{
- $routing['function'] = ($routing['function'] === '') ? 'index' : $routing['function'];
+ $routing['function'] = ($routing['function'] == '') ? 'index' : $routing['function'];
$this->set_method($routing['function']);
}
}
diff --git a/system/core/Security.php b/system/core/Security.php
index 9cbcd92..4593a10 100755
--- a/system/core/Security.php
+++ b/system/core/Security.php
@@ -847,4 +847,4 @@
}
/* End of file Security.php */
-/* Location: ./system/core/Security.php */
+/* Location: ./system/core/Security.php */
\ No newline at end of file
diff --git a/system/core/URI.php b/system/core/URI.php
index 0afb374..a575bc3 100755
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -111,7 +111,7 @@
// Is there a PATH_INFO variable?
// Note: some servers seem to have trouble with getenv() so we'll test it two ways
- $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO');
+ $path = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO');
if (trim($path, '/') !== '' && $path !== '/'.SELF)
{
$this->_set_uri_string($path);
diff --git a/system/core/Utf8.php b/system/core/Utf8.php
index 2b5a1f5..0a7ec50 100644
--- a/system/core/Utf8.php
+++ b/system/core/Utf8.php
@@ -54,7 +54,7 @@
if (
@preg_match('/./u', 'é') === 1 // PCRE must support UTF-8
&& function_exists('iconv') // iconv must be installed
- && @ini_get('mbstring.func_overload') !== 1 // Multibyte string function overloading cannot be enabled
+ && (bool) @ini_get('mbstring.func_overload') !== TRUE // Multibyte string function overloading cannot be enabled
&& $CFG->item('charset') === 'UTF-8' // Application charset must be UTF-8
)
{