X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/15c39c1976cf26e7ed35d1787ad089495c6777f7..refs/pull/2515/head:/app/Providers/AppServiceProvider.php diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index e45a0be92..1c6180a1f 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -1,18 +1,18 @@ getClientOriginalExtension()), $validImageExtensions); - }); - - Validator::extend('no_double_extension', function ($attribute, $value, $parameters, $validator) { - $uploadName = $value->getClientOriginalName(); - return substr_count($uploadName, '.') < 2; - }); + // Set root URL + $appUrl = config('app.url'); + if ($appUrl) { + $isHttps = (strpos($appUrl, 'https://') === 0); + URL::forceRootUrl($appUrl); + URL::forceScheme($isHttps ? 'https' : 'http'); + } // Custom blade view directives Blade::directive('icon', function ($expression) { return ""; }); - Blade::directive('exposeTranslations', function($expression) { - return "startPush('translations'); ?>" . - "" . - '' . "\n" . - "" . - 'stopPush(); ?>'; - }); - // Allow longer string lengths after upgrade to utf8mb4 Schema::defaultStringLength(191);