X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/3acea12f1c0013be4f1e3994cae2ea662e43bb4e..refs/pull/2515/head:/app/Providers/AppServiceProvider.php diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index a2fc673f4..1c6180a1f 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -1,11 +1,11 @@ getClientOriginalExtension()), $validImageExtensions); - }); - - Validator::extend('no_double_extension', function ($attribute, $value, $parameters, $validator) { - $uploadName = $value->getClientOriginalName(); - return substr_count($uploadName, '.') < 2; - }); + $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);