mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Updated and improved StaticExporter
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42536 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
0bf09f0df0
commit
fad2ab3eda
@ -160,7 +160,7 @@ class HTTP {
|
||||
global $global_mimetypes;
|
||||
if(!$global_mimetypes) self::loadMimeTypes();
|
||||
$ext = strtolower(substr($filename,strrpos($filename,'.')+1));
|
||||
return $global_mimetypes[$ext];
|
||||
if(isset($global_mimetypes[$ext])) return $global_mimetypes[$ext];
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -190,6 +190,12 @@ class Director {
|
||||
}
|
||||
|
||||
static function protocolAndHost() {
|
||||
if(self::$alternateBaseURL) {
|
||||
if(preg_match('/^(http[^:]*:\/\/[^/]+)\//1', self::$alternateBaseURL, $matches)) {
|
||||
return $matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
$s = (isset($_SERVER['SSL']) || isset($_SERVER['HTTPS'])) ? 's' : '';
|
||||
return "http$s://" . $_SERVER['HTTP_HOST'];
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ class Filesystem extends Object {
|
||||
static function removeFolder( $folder ) {
|
||||
|
||||
// remove a file encountered by a recursive call.
|
||||
if( !is_dir( $folder ) )
|
||||
if( !is_dir( $folder ) || is_link($folder) )
|
||||
unlink( $folder );
|
||||
else {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user