diff --git a/src/Entity/Attachments/Attachment.php b/src/Entity/Attachments/Attachment.php index dcc177a5..9c86ca87 100644 --- a/src/Entity/Attachments/Attachment.php +++ b/src/Entity/Attachments/Attachment.php @@ -455,7 +455,7 @@ abstract class Attachment extends AbstractNamedDBElement * * @return bool True if the string is a valid URL. False, if the string is not an URL or invalid. */ - public static function isURL(string $string, bool $path_required = true, bool $only_http = true): bool + public static function isValidURL(string $string, bool $path_required = true, bool $only_http = true): bool { if ($only_http) { //Check if scheme is HTTPS or HTTP $scheme = parse_url($string, PHP_URL_SCHEME); diff --git a/tests/Entity/Attachments/AttachmentTest.php b/tests/Entity/Attachments/AttachmentTest.php index 182d3049..7eab56f2 100644 --- a/tests/Entity/Attachments/AttachmentTest.php +++ b/tests/Entity/Attachments/AttachmentTest.php @@ -285,14 +285,14 @@ class AttachmentTest extends TestCase public function testIsURL(): void { $url = '%MEDIA%/test.txt'; - $this->assertFalse(Attachment::isURL($url)); + $this->assertFalse(Attachment::isValidURL($url)); $url = 'https://google.de'; - $this->assertFalse(Attachment::isURL($url)); + $this->assertFalse(Attachment::isValidURL($url)); $url = 'ftp://google.de'; - $this->assertTrue(Attachment::isURL($url, false, false)); - $this->assertFalse(Attachment::isURL($url, false, true)); + $this->assertTrue(Attachment::isValidURL($url, false, false)); + $this->assertFalse(Attachment::isValidURL($url, false, true)); } /**