summaryrefslogtreecommitdiff
path: root/framework/Web/THttpResponse.php
diff options
context:
space:
mode:
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);