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

@ -417,7 +417,7 @@ abstract class Attachment extends AbstractNamedDBElement
{
//Only set if the URL is not empty
if (!empty($url)) {
if (false !== strpos($url, '%BASE%') || false !== strpos($url, '%MEDIA%')) {
if (str_contains($url, '%BASE%') || str_contains($url, '%MEDIA%')) {
throw new InvalidArgumentException('You can not reference internal files via the url field! But nice try!');
}