mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 11:24:31 +02:00
Use str_contains and similar instead of strpos
This commit is contained in:
parent
508de10191
commit
1dbf36b86b
16 changed files with 18 additions and 19 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue