fix rendering of collage urls with no collage id

This commit is contained in:
Spine
2025-07-02 09:00:03 +00:00
parent d30d1fe522
commit 945db24553
2 changed files with 9 additions and 0 deletions

View File

@@ -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 "<a href=\"$rawurl\">$url</a>";
}
return self::bbcodeCollageUrl((int)($args['id'] ?? $args['collageid']));
case '/forums.php':

View File

@@ -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(
"<a href=\"$url\">" . htmlentities($url) . "</a>",
\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(