Check for invalid characters before trimming

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/29907/head
Joas Schilling 2021-11-25 08:48:26 +07:00 committed by backportbot[bot]
parent 2dd3b6f0b1
commit f700abc889
1 changed files with 1 additions and 1 deletions

@ -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();