summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-07 20:29:23 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-07 20:29:23 +0200
commit3427797a2899506adbe5317671fe0b3c27c2a6a6 (patch)
tree199fd08da90a1e37f5c7f4d75e4af957dc5e7278 /system/core
parent968690491f625ddf59a5136b55ae1b9a2cf98a9a (diff)
parent25d47aec0417e52af43985663ebc1f62931f13cd (diff)
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop-db-sqlite
Diffstat (limited to 'system/core')
-rwxr-xr-xsystem/core/Input.php2
-rwxr-xr-xsystem/core/Output.php12
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);
}