diff --git a/class2.php b/class2.php index 03fa2018f..b955b305d 100644 --- a/class2.php +++ b/class2.php @@ -2672,12 +2672,6 @@ class e_http_header $this->setHeader("X-Powered-By: e107", true); // no less secure than e107-specific html. } - if(defined('e_HTTP_STATIC')) - { - // $this->setHeader("Access-Control-Allow-Origin: *",true); - $this->setHeader("Access-Control-Allow-Origin: ".rtrim(e_HTTP_STATIC,'/'), true); - } - if($this->compression_server_support == true) { $this->setHeader('Vary: Accept-Encoding'); diff --git a/e107.htaccess b/e107.htaccess index c3bfc3609..7b029135a 100644 --- a/e107.htaccess +++ b/e107.htaccess @@ -13,6 +13,8 @@ ### Security ServerSignature Off +#Header unset Pragma + # secure htaccess file order allow,deny @@ -103,11 +105,11 @@ AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript application/xml text/xml application/rss+xml - + Header set Cache-Control "public" Header unset Cookie Header unset Set-Cookie - # Header set Access-Control-Allow-Origin "http://static.mydomain.com" + # Header set Access-Control-Allow-Origin "http://mydomain.com" diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index d172416dd..e90eb291c 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -2529,6 +2529,11 @@ class e_parse extends e_parser if($raw) $url = $this->createConstants($url, 'mix'); $baseurl = ($full ? SITEURL : e_HTTP).'thumb.php?'; + + if(defined('e_HTTP_STATIC')) + { + $baseurl = e_HTTP_STATIC.'thumb.php?'; + } $thurl = 'src='.urlencode($url).'&'; @@ -2722,6 +2727,11 @@ class e_parse extends e_parser { $base = (!empty($options['ebase'])) ? '{e_BASE}' : e_HTTP; } + + if(defined('e_HTTP_STATIC')) + { + $base = e_HTTP_STATIC; + } // $base = (!empty($options['full'])) ? SITEURL : e_HTTP; if(!empty($options['x']) && !empty($options['ext'])) // base64 encoded. Build URL for: RewriteRule ^media\/img\/([-A-Za-z0-9+/]*={0,3})\.(jpg|gif|png)?$ thumb.php?id=$1 @@ -5114,6 +5124,8 @@ class e_emotefilter return; } + $base = deftrue('e_HTTP_STATIC', SITEURLBASE); + foreach($this->emotes as $key => $value) { @@ -5130,8 +5142,10 @@ class e_emotefilter $key = str_replace("!", "_", $key); $filename = e_IMAGE."emotes/" . $pref['emotepack'] . "/" . $key; + + - $fileloc = SITEURLBASE.e_IMAGE_ABS."emotes/" . $pref['emotepack'] . "/" . $key; + $fileloc = $base.e_IMAGE_ABS."emotes/" . $pref['emotepack'] . "/" . $key; $alt = str_replace(array('.png','.gif', '.jpg'),'', $key); diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php index a0f9a74cb..989a1b5c8 100644 --- a/e107_handlers/js_manager.php +++ b/e107_handlers/js_manager.php @@ -1256,7 +1256,7 @@ class e_jsmanager if(strpos($path, 'http') !== 0) { $path = $tp->replaceConstants($path, 'abs').'?external=1'; // &'.$this->getCacheId(); - $path = $this->url($path,'css'); + $path = $this->url($path); } echo $pre.''.$post; @@ -1276,7 +1276,7 @@ class e_jsmanager $path = $path[0]; $path = $tp->replaceConstants($path, 'abs').'?external=1'; // &'.$this->getCacheId(); - $path = $this->url($path,'js'); + $path = $this->url($path); echo $pre.''.$post; echo "\n"; continue; @@ -1328,7 +1328,7 @@ class e_jsmanager continue; } $path = $tp->replaceConstants($path, 'abs'); // .'?'.$this->getCacheId(); - $path = $this->url($path, 'css'); + $path = $this->url($path); } elseif($this->isValidUrl($path) === false) { @@ -1401,11 +1401,10 @@ class e_jsmanager - private function url($path,$type) + private function url($path,$cacheId = true) { - if(e_MOD_REWRITE_STATIC === true && $this->isInAdmin() !== true) + if((e_MOD_REWRITE_STATIC === true || defined('e_HTTP_STATIC')) && $this->isInAdmin() !== true) { - $base = 'static/'; $srch = array( e_PLUGIN_ABS, @@ -1413,17 +1412,25 @@ class e_jsmanager e_WEB_ABS ); + $http = deftrue('e_HTTP_STATIC', e_HTTP); + $base = (e_MOD_REWRITE_STATIC === true) ? 'static/'.$this->getCacheId().'/' : ''; + $repl = array( - $http.$base.$this->getCacheId().'/'.e107::getFolder('plugins'), - $http.$base.$this->getCacheId().'/'.e107::getFolder('themes'), - $http.$base.$this->getCacheId().'/'.e107::getFolder('web') + $http.$base.e107::getFolder('plugins'), + $http.$base.e107::getFolder('themes'), + $http.$base.e107::getFolder('web') ); $folder = str_replace($srch,$repl,$path); - return trim($folder); + if(e_MOD_REWRITE_STATIC === true) + { + return trim($folder); + } + + $path = $folder; } @@ -1534,11 +1541,11 @@ class e_jsmanager if($type == 'js') { - echo "\n\n"; + echo "\n\n"; } else { - echo "\n\n"; + echo "\n\n"; if(!empty($this->_cache_list['css_inline'])) { echo $this->_cache_list['css_inline']; diff --git a/e107_plugins/download/e_url.php b/e107_plugins/download/e_url.php index 0faef0e5e..f03c2252a 100644 --- a/e107_plugins/download/e_url.php +++ b/e107_plugins/download/e_url.php @@ -105,7 +105,7 @@ class download_url // plugin-folder + '_url' $config['item'] = array( 'regex' => '^{alias}/([\d]*)/(.*)$', 'redirect' => '{e_PLUGIN}download/download.php?action=view&id=$1', - 'sef' => '{alias}/{download_id}/{download_sef}' + 'sef' => '{alias}/{download_id}/{download_sef}', ); $config['get'] = array(