diff options
Diffstat (limited to 'system/core')
-rwxr-xr-x | system/core/Input.php | 2 | ||||
-rwxr-xr-x | system/core/Output.php | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/system/core/Input.php b/system/core/Input.php index 73f46ba6a..b986c4973 100755 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -383,7 +383,7 @@ class CI_Input { */ public function valid_ip($ip) { - return (bool) filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); + return (bool) filter_var($ip, FILTER_VALIDATE_IP); } // -------------------------------------------------------------------- diff --git a/system/core/Output.php b/system/core/Output.php index 09656711b..5588ffe8e 100755 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -200,7 +200,7 @@ class CI_Output { * @param string extension of the file we're outputting * @return void */ - public function set_content_type($mime_type) + public function set_content_type($mime_type, $charset = NULL) { if (strpos($mime_type, '/') === FALSE) { @@ -218,7 +218,13 @@ class CI_Output { } } - $header = 'Content-Type: '.$mime_type; + if (empty($charset)) + { + $charset = config_item('charset'); + } + + $header = 'Content-Type: '.$mime_type + .(empty($charset) ? NULL : '; charset='.strtolower($charset)); $this->headers[] = array($header, TRUE); return $this; @@ -364,7 +370,7 @@ class CI_Output { if ($this->parse_exec_vars === TRUE) { - $memory = function_exists('memory_get_usage') ? round(memory_get_usage()/1024/1024, 2).'MB' : '0'; + $memory = round(memory_get_usage() / 1024 / 1024, 2).'MB'; $output = str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsed, $memory), $output); } |