Always HTTPS + some phpcs

This commit is contained in:
Vincent BRIDIER 2023-01-10 09:21:53 +01:00
parent 9f85fe88f4
commit b7f38e80ff
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
3 changed files with 9 additions and 11 deletions

View file

@ -33,11 +33,9 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
// LOCAL HTTPS FIX
if (config('app.env') !== 'local') {
URL::forceScheme('https');
}
// HA PROXY FIX
URL::forceScheme('https');
// HA PROXY FIX.
App::singleton('clientIp', function () {
if (config('app.env') === 'local') {
return request()->getClientIp();
@ -56,7 +54,7 @@ class AppServiceProvider extends ServiceProvider
}
Carbon::setLocale(config('app.locale'));
// force bootstrap paginator
// Force bootstrap paginator.
Paginator::useBootstrap();
if (!app()->runningInConsole()) {
@ -87,11 +85,11 @@ class AppServiceProvider extends ServiceProvider
}//end if
Blade::directive('svg', function ($arguments) {
// Funky madness to accept multiple arguments into the directive
// Funky madness to accept multiple arguments into the directive.
list($path, $class) = array_pad(explode(',', trim($arguments, "() ")), 2, '');
$path = trim($path, "' ");
$class = trim($class, "' ");
// Create the dom document as per the other answers
// Create the dom document as per the other answers.
$svg = new \DOMDocument();
$svg->load(public_path($path));
$svg->documentElement->setAttribute("class", $class);

View file

@ -82,11 +82,11 @@ class RouteServiceProvider extends ServiceProvider
try {
return ArticleCategory::make($value);
} catch (BadMethodCallException | EnumNotRoutableException $e) {
// handle old article route
// Handle old article route.
$publishedArticle = Articles::where('id', $value)
->orWhere('slug', $value)->where('status', true)->first();
if ($publishedArticle) {
// redirect permanent, throw redirect exception using send method
// Redirect permanent, throw redirect exception using send method.
\redirect(route('club.infos.child', [
'articleTag' => $publishedArticle->type,
'publishedArticle' => $publishedArticle

View file

@ -78,7 +78,7 @@ Route::prefix('bo')
->middleware('xss:content');
Route::resource('product-pictograms', ProductPictogramsController::class);
// Disabled product sliders Cf tasks Le Gaulois #PSP
// Route::resource('product-slider-pictures', 'ProductSliderPicturesController');
// Route::resource('product-slider-pictures', 'ProductSliderPicturesController');.
Route::resource('products', ProductsController::class)->except(['show'])
->withoutMiddleware('xss')
->middleware('xss:preparation_advice,ingredients,tips');