fix url() function when using CDN
This commit is contained in:
parent
5304062b40
commit
446149c9ef
|
|
@ -15,7 +15,13 @@ class AppServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
// replace HTTP_HOST with site url setted in options to prevent CDN source problems
|
||||
preg_match('/https?:\/\/([^\/]+)\/?.*/', option('site_url'), $host);
|
||||
|
||||
// check if host is valid
|
||||
if (isset($host[1]) && '' === preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/', '', $host[1])) {
|
||||
$this->app['request']->headers->set('host', $host[1]);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user