diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/core/Common.php | 17 | ||||
-rw-r--r-- | system/core/Output.php | 10 | ||||
-rw-r--r-- | system/libraries/Session/drivers/Session_cookie.php | 2 | ||||
-rw-r--r-- | system/libraries/Zip.php | 2 |
4 files changed, 19 insertions, 12 deletions
diff --git a/system/core/Common.php b/system/core/Common.php index 7feb16bfd..c7ab387a3 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -681,17 +681,22 @@ if ( ! function_exists('function_usable')) { if ( ! isset($_suhosin_func_blacklist)) { - $_suhosin_func_blacklist = extension_loaded('suhosin') - ? array() - : explode(',', trim(@ini_get('suhosin.executor.func.blacklist'))); + if (extension_loaded('suhosin')) + { + $_suhosin_func_blacklist = explode(',', trim(@ini_get('suhosin.executor.func.blacklist'))); - if ( ! in_array('eval', $_suhosin_func_blacklist, TRUE) && @ini_get('suhosin.executor.disable_eval')) + if ( ! in_array('eval', $_suhosin_func_blacklist, TRUE) && @ini_get('suhosin.executor.disable_eval')) + { + $_suhosin_func_blacklist[] = 'eval'; + } + } + else { - $_suhosin_func_blacklist[] = 'eval'; + $_suhosin_func_blacklist = array(); } } - return in_array($function_name, $_suhosin_func_blacklist, TRUE); + return ! in_array($function_name, $_suhosin_func_blacklist, TRUE); } return FALSE; diff --git a/system/core/Output.php b/system/core/Output.php index 7a7380ce1..78eb8c654 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -780,6 +780,7 @@ class CI_Output { break; case 'text/css': + case 'text/javascript': //Remove CSS comments $output = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $output); @@ -788,11 +789,12 @@ class CI_Output { // semi-colons, parenthesis, commas $output = preg_replace('!\s*(:|;|,|}|{|\(|\))\s*!', '$1', $output); - break; + // Remove spaces + $output = preg_replace('/ /s', ' ', $output); - case 'text/javascript': + // Remove breaklines and tabs + $output = preg_replace('/[\r\n\t]/', '', $output); - // Currently leaves JavaScript untouched. break; default: break; @@ -804,4 +806,4 @@ class CI_Output { } /* End of file Output.php */ -/* Location: ./system/core/Output.php */
\ No newline at end of file +/* Location: ./system/core/Output.php */ diff --git a/system/libraries/Session/drivers/Session_cookie.php b/system/libraries/Session/drivers/Session_cookie.php index 6d926ae3d..9392a4dbe 100644 --- a/system/libraries/Session/drivers/Session_cookie.php +++ b/system/libraries/Session/drivers/Session_cookie.php @@ -457,7 +457,7 @@ class CI_Session_cookie extends CI_Session_driver { } // No result? Kill it! - if ($query->num_rows() === 0) + if (empty($query) OR $query->num_rows() === 0) { $this->sess_destroy(); return FALSE; diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 77cc45b38..740e99c72 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -133,7 +133,7 @@ class CI_Zip { protected function _get_mod_time($dir) { // filemtime() may return false, but raises an error for non-existing files - $date = file_exists($dir) ? filemtime($dir) : getdate($this->now); + $date = file_exists($dir) ? @filemtime($dir) : getdate($this->now); return array( 'file_mtime' => ($date['hours'] << 11) + ($date['minutes'] << 5) + $date['seconds'] / 2, |