diff --git a/classes/text.class.php b/classes/text.class.php
index 11b20c235..d3ca4e180 100644
--- a/classes/text.class.php
+++ b/classes/text.class.php
@@ -359,6 +359,9 @@ class Text {
return new \Gazelle\Manager\Artist()->findById((int)($args['id'] ?? 0))?->link();
case '/collages.php':
+ if (!isset($args['id']) && !isset($args['collageid'])) {
+ return "$url";
+ }
return self::bbcodeCollageUrl((int)($args['id'] ?? $args['collageid']));
case '/forums.php':
diff --git a/tests/phpunit/TextTest.php b/tests/phpunit/TextTest.php
index fe9b2a44e..545a60a59 100644
--- a/tests/phpunit/TextTest.php
+++ b/tests/phpunit/TextTest.php
@@ -124,6 +124,12 @@ class TextTest extends TestCase {
\Text::full_format($collage->publicLocation()),
'text-collage-url'
);
+ $url = SITE_URL . '/collages.php?order=subscribers&sort=desc&page=2';
+ $this->assertEquals(
+ "" . htmlentities($url) . "",
+ \Text::full_format($url),
+ 'text-collage-url-no-id',
+ );
$commentMan = new Manager\Comment();
$comment = $commentMan->create($this->userList['admin'], 'collages', $collage->id, "nice collage!");
$this->assertEquals(