mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-23 12:24:45 +02:00
Fixed some more phpstan issues
This commit is contained in:
parent
2f46fbfc7a
commit
e8771ea118
77 changed files with 192 additions and 109 deletions
|
@ -220,7 +220,7 @@ class AttachmentSubmitHandler
|
|||
|
||||
|
||||
//Check if the extension is blacklisted and replace the file extension with txt if needed
|
||||
if(in_array($ext, self::BLACKLISTED_EXTENSIONS)) {
|
||||
if(in_array($ext, self::BLACKLISTED_EXTENSIONS, true)) {
|
||||
$new_path = $this->generateAttachmentPath($attachment, $attachment->isSecure())
|
||||
.DIRECTORY_SEPARATOR.$this->generateAttachmentFilename($attachment, 'txt');
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class FileTypeFilterTools
|
|||
$element = trim($element);
|
||||
if (!preg_match('#^\.\w+$#', $element) // .ext is allowed
|
||||
&& !preg_match('#^[-\w.]+/[-\w.]+#', $element) //Explicit MIME type is allowed
|
||||
&& !in_array($element, static::ALLOWED_MIME_PLACEHOLDERS, false)) { //image/* is allowed
|
||||
&& !in_array($element, static::ALLOWED_MIME_PLACEHOLDERS, true)) { //image/* is allowed
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -173,6 +173,6 @@ class FileTypeFilterTools
|
|||
{
|
||||
$extension = strtolower($extension);
|
||||
|
||||
return $filter === '' || in_array($extension, $this->resolveFileExtensions($filter), false);
|
||||
return $filter === '' || in_array($extension, $this->resolveFileExtensions($filter), true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue