Skip to content

Commit ca770ba

Browse files
committed
[WebRequest] Fix directory sanitizing for windows
1 parent 175d9fa commit ca770ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Library/WebRequest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ public static function receiveFile($field, $directory, $allowedTypes, $rename =
461461

462462
// Remove invalid word character
463463
$real = strlen($path);
464-
$path = preg_replace('/[^\\pN\\pL.\\/:;\'"\\[\\]{}!@#$%^&*()_+\\-=|]+/', '', $path);
464+
$path = preg_replace('/[^\\pN\\pL.\\/:;\'"\\\\\/\\[\\]{}!@#$%^&*()_+\\-=|]+/', '', $path);
465465

466466
// Use timestamp if no valid character left
467467
if(strlen($path) !== $real && ($path === '' || $path[0] === '.'))

0 commit comments

Comments
 (0)