Check for invalid characters before trimming

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/30834/head
Joas Schilling 3 years ago committed by backportbot[bot]
parent c8ca2da5a6
commit 787897bf5e

@ -554,8 +554,8 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
* @throws InvalidPathException
*/
protected function verifyPosixPath($fileName) {
$fileName = trim($fileName);
$this->scanForInvalidCharacters($fileName, "\\/");
$fileName = trim($fileName);
$reservedNames = ['*'];
if (in_array($fileName, $reservedNames)) {
throw new ReservedWordException();

Loading…
Cancel
Save