Use str_contains and similar instead of strpos

This commit is contained in:
Jan Böhmer 2023-05-27 23:58:28 +02:00
parent 508de10191
commit 1dbf36b86b
16 changed files with 18 additions and 19 deletions

View file

@ -134,7 +134,7 @@ class AttachmentPathResolver
$count = 0;
//When path is a footprint we have to first run the string through our lecagy german mapping functions
if (strpos($placeholder_path, '%FOOTPRINTS%') !== false) {
if (str_contains($placeholder_path, '%FOOTPRINTS%')) {
$placeholder_path = $this->convertOldFootprintPath($placeholder_path);
}
@ -151,7 +151,7 @@ class AttachmentPathResolver
}
//Path is invalid if path is directory traversal
if (false !== strpos($placeholder_path, '..')) {
if (str_contains($placeholder_path, '..')) {
return null;
}