sharp icon indicating copy to clipboard operation
sharp copied to clipboard

LangController doesn’t use the locale parameter

Open mlajx opened this issue 4 years ago • 0 comments

LangController doesn’t use the locale parameter

First of all, I apologize for my english, this is not my native language.

In my search for how I could 'force' the language definition for sharp, I realized that it always carries the url "/vendor/sharp/lang.js?version=5.2.0&locale={{lang}}", in where {{lang}} is the current language configured in laravel.

But I noticed in the LangController file, that it doesn’t get this locale parameter:

//...

$lang = app()->getLocale();

//...

I want to send a PR with the following solution

use Illuminate\Http\Request;


public function index(Request $request)
{
        $lang = $request->input('locale') ?? app()->getLocale();

        //...
}

But I would like to know before I do the PR if there is any kind of problem, conflict or vulnerability that can happen.

mlajx avatar Oct 09 '20 21:10 mlajx