summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorbrian978 <dbrian89@yahoo.com>2012-12-18 12:23:14 +0100
committerbrian978 <dbrian89@yahoo.com>2012-12-18 12:23:14 +0100
commit0fb101849e53593fdceb7064f32ea5176e6eed16 (patch)
treee33629f2352da2715d559364af955d6dda59d203 /system/core
parent07ccbe59cf9d78d944551f810a14064e979840a3 (diff)
parentd8dba5d3ecbe1ff4502b04a9cf3086908db140d1 (diff)
Merge remote-tracking branch 'upstream/develop' into develop
Diffstat (limited to 'system/core')
-rw-r--r--system/core/Common.php17
-rw-r--r--system/core/Output.php24
-rw-r--r--system/core/Security.php4
3 files changed, 26 insertions, 19 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 98deff55c..0ba0a5743 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -143,7 +143,7 @@ class CI_Output {
* Sets the output string.
*
* @param string $output Output data
- * @return object $this
+ * @return CI_Output
*/
public function set_output($output)
{
@@ -159,7 +159,7 @@ class CI_Output {
* Appends data onto the output string.
*
* @param string $output Data to append
- * @return object $this
+ * @return CI_Output
*/
public function append_output($output)
{
@@ -187,7 +187,7 @@ class CI_Output {
*
* @param string $header Header
* @param bool $replace Whether to replace the old header value, if already set
- * @return object $this
+ * @return CI_Output
*/
public function set_header($header, $replace = TRUE)
{
@@ -211,7 +211,7 @@ class CI_Output {
*
* @param string $mime_type Extension of the file we're outputting
* @param string $charset Character set (default: NULL)
- * @return object $this
+ * @return CI_Output
*/
public function set_content_type($mime_type, $charset = NULL)
{
@@ -308,7 +308,7 @@ class CI_Output {
*
* @param int $code Status code (default: 200)
* @param string $text Optional message
- * @return object $this
+ * @return CI_Output
*/
public function set_status_header($code = 200, $text = '')
{
@@ -322,7 +322,7 @@ class CI_Output {
* Enable/disable Profiler
*
* @param bool $val TRUE to enable or FALSE to disable
- * @return object $this
+ * @return CI_Output
*/
public function enable_profiler($val = TRUE)
{
@@ -339,7 +339,7 @@ class CI_Output {
* Profiler section display.
*
* @param array $sections Profiler sections
- * @return object $this
+ * @return CI_Output
*/
public function set_profiler_sections($sections)
{
@@ -363,7 +363,7 @@ class CI_Output {
* Set Cache
*
* @param int $time Cache expiration time in seconds
- * @return object $this
+ * @return CI_Output
*/
public function cache($time)
{
@@ -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;
diff --git a/system/core/Security.php b/system/core/Security.php
index 70e9e973c..8c70e85de 100644
--- a/system/core/Security.php
+++ b/system/core/Security.php
@@ -151,7 +151,7 @@ class CI_Security {
/**
* CSRF Verify
*
- * @return object
+ * @return CI_Security
*/
public function csrf_verify()
{
@@ -202,7 +202,7 @@ class CI_Security {
* CSRF Set Cookie
*
* @codeCoverageIgnore
- * @return object
+ * @return CI_Security
*/
public function csrf_set_cookie()
{