mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-14 06:59:30 +00:00
Applied rector suggestions
This commit is contained in:
parent
4106bcef5f
commit
20f32c7f12
170 changed files with 808 additions and 761 deletions
|
|
@ -139,12 +139,12 @@ class AttachmentPathResolver
|
|||
}
|
||||
|
||||
//If we have now have a placeholder left, the string is invalid:
|
||||
if (preg_match('#%\w+%#', $placeholder_path)) {
|
||||
if (preg_match('#%\w+%#', (string) $placeholder_path)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
//Path is invalid if path is directory traversal
|
||||
if (str_contains($placeholder_path, '..')) {
|
||||
if (str_contains((string) $placeholder_path, '..')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -183,7 +183,7 @@ class AttachmentPathResolver
|
|||
}
|
||||
|
||||
//If the new string does not begin with a placeholder, it is invalid
|
||||
if (!preg_match('#^%\w+%#', $real_path)) {
|
||||
if (!preg_match('#^%\w+%#', (string) $real_path)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue