mirror of
https://github.com/Mibew/mibew.git
synced 2024-11-15 08:34:11 +03:00
Add check for null values for incoming params
This commit is contained in:
parent
1ed31ad638
commit
5fa9663d99
@ -39,6 +39,7 @@ class TranslationController extends AbstractController
|
|||||||
$operator = $this->getOperator();
|
$operator = $this->getOperator();
|
||||||
|
|
||||||
$target = $request->query->get('target');
|
$target = $request->query->get('target');
|
||||||
|
$target = is_null($target) ? '' : $target;
|
||||||
if (!preg_match("/^[\w-]{2,5}$/", $target)) {
|
if (!preg_match("/^[\w-]{2,5}$/", $target)) {
|
||||||
$target = get_current_locale();
|
$target = get_current_locale();
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ class TranslationExportController extends AbstractController
|
|||||||
$operator = $this->getOperator();
|
$operator = $this->getOperator();
|
||||||
|
|
||||||
$target = $request->request->get('target');
|
$target = $request->request->get('target');
|
||||||
|
$target = is_null($target) ? '' : $target;
|
||||||
if (!preg_match("/^[\w-]{2,5}$/", $target)) {
|
if (!preg_match("/^[\w-]{2,5}$/", $target)) {
|
||||||
$target = get_current_locale();
|
$target = get_current_locale();
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ class TranslationImportController extends AbstractController
|
|||||||
$operator = $this->getOperator();
|
$operator = $this->getOperator();
|
||||||
|
|
||||||
$target = $request->request->get('target');
|
$target = $request->request->get('target');
|
||||||
|
$target = is_null($target) ? '' : $target;
|
||||||
if (!preg_match("/^[\w-]{2,5}$/", $target)) {
|
if (!preg_match("/^[\w-]{2,5}$/", $target)) {
|
||||||
$target = get_current_locale();
|
$target = get_current_locale();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user