summaryrefslogtreecommitdiff
path: root/framework/Web/THttpResponse.php
diff options
context:
space:
mode:
authorxue <>2006-04-20 17:09:09 +0000
committerxue <>2006-04-20 17:09:09 +0000
commitc54a230a5926086ff1b69a0dd7e6352dbc0b40ff (patch)
tree4006daa2f5f5d0cfb90ebc028b9820b077df4a69 /framework/Web/THttpResponse.php
parent3ff35ae583c52e54418a61cabf3282c00a8039d1 (diff)
Merge from 3.0 branch till 947.
Diffstat (limited to 'framework/Web/THttpResponse.php')
-rw-r--r--framework/Web/THttpResponse.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php
index 18be9fec..29258259 100644
--- a/framework/Web/THttpResponse.php
+++ b/framework/Web/THttpResponse.php
@@ -238,15 +238,14 @@ class THttpResponse extends TModule implements ITextWriter
if($mimeType===null)
{
+ $mimeType='text/plain';
if(function_exists('mime_content_type'))
$mimeType=mime_content_type($fileName);
- else
+ else if(($ext=strrchr($fileName,'.'))!==false)
{
- $ext=array_pop(explode('.',$fileName));
+ $ext=substr($ext,1);
if(isset($defaultMimeTypes[$ext]))
$mimeType=$defaultMimeTypes[$ext];
- else
- $mimeType='text/plain';
}
}
$fn=basename($fileName);