mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 11:48:49 +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
|
@ -110,7 +110,7 @@ class LabelResponse extends Response
|
|||
*/
|
||||
public function setContentDisposition(string $disposition, string $filename, string $filenameFallback = ''): self
|
||||
{
|
||||
if ('' === $filenameFallback && (!preg_match('/^[\x20-\x7e]*$/', $filename) || false !== strpos($filename, '%'))) {
|
||||
if ('' === $filenameFallback && (!preg_match('/^[\x20-\x7e]*$/', $filename) || str_contains($filename, '%'))) {
|
||||
$encoding = mb_detect_encoding($filename, null, true) ?: '8bit';
|
||||
|
||||
for ($i = 0, $filenameLength = mb_strlen($filename, $encoding); $i < $filenameLength; ++$i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue