Skip to content

Commit

Permalink
[WebRequest] Fix directory sanitizing for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
StefansArya committed Jan 15, 2020
1 parent 175d9fa commit ca770ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Library/WebRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ public static function receiveFile($field, $directory, $allowedTypes, $rename =

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

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

0 comments on commit ca770ba

Please sign in to comment.