Fix point usage in regex
modifié: core/lib/Thelia/Controller/Admin/FileController.php
This commit is contained in:
@@ -110,7 +110,7 @@ class FileController extends BaseAdminController
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$regex = "#(".implode("|", $validMimeTypes[$mimeType]).")$#i";
|
$regex = "#^(.+)\.(".implode("|", $validMimeTypes[$mimeType]).")$#i";
|
||||||
|
|
||||||
if (!preg_match($regex, $realFileName)) {
|
if (!preg_match($regex, $realFileName)) {
|
||||||
$message = $this->getTranslator()
|
$message = $this->getTranslator()
|
||||||
@@ -125,7 +125,7 @@ class FileController extends BaseAdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($extBlackList)) {
|
if (!empty($extBlackList)) {
|
||||||
$regex = "#(".implode("|", $extBlackList).")$#i";
|
$regex = "#^(.+)\.(".implode("|", $extBlackList).")$#i";
|
||||||
|
|
||||||
if (preg_match($regex, $realFileName)) {
|
if (preg_match($regex, $realFileName)) {
|
||||||
$message = $this->getTranslator()
|
$message = $this->getTranslator()
|
||||||
@@ -207,9 +207,9 @@ class FileController extends BaseAdminController
|
|||||||
$parentType,
|
$parentType,
|
||||||
'image',
|
'image',
|
||||||
[
|
[
|
||||||
'image/jpeg' => [".jpg", ".jpeg"],
|
'image/jpeg' => ["jpg", "jpeg"],
|
||||||
'image/png' => [".png"],
|
'image/png' => ["png"],
|
||||||
'image/gif' => [".gif"],
|
'image/gif' => ["gif"],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -230,13 +230,13 @@ class FileController extends BaseAdminController
|
|||||||
'document',
|
'document',
|
||||||
[],
|
[],
|
||||||
[
|
[
|
||||||
".php",
|
"php",
|
||||||
".php3",
|
"php3",
|
||||||
".php4",
|
"php4",
|
||||||
".php5",
|
"php5",
|
||||||
".php6",
|
"php6",
|
||||||
".asp",
|
"asp",
|
||||||
".aspx",
|
"aspx",
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user