Merge pull request #133 from icewind1991/log-invalid-path

include the invalid path in error message
This commit is contained in:
Robin Appelman 2025-03-13 18:44:09 +01:00 committed by GitHub
commit 4b9add1221
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,7 +23,7 @@ abstract class AbstractShare implements IShare {
protected function verifyPath(string $path): void { protected function verifyPath(string $path): void {
foreach ($this->forbiddenCharacters as $char) { foreach ($this->forbiddenCharacters as $char) {
if (strpos($path, $char) !== false) { if (strpos($path, $char) !== false) {
throw new InvalidPathException('Invalid path, "' . $char . '" is not allowed'); throw new InvalidPathException("Invalid path \"$path\", \"$char\" is not allowed");
} }
} }
} }