Display tags as lowercase

dev
gravel 2 years ago
parent d3f1707f5c
commit 6fc91007a4
Signed by: gravel
GPG Key ID: C0538F3C906B308F

@ -33,10 +33,17 @@
return strtolower($this->text); return strtolower($this->text);
} }
/**
* Returns a lowercase representation of the tag for use in display.
*/
public function get_text(): string {
return strtolower($this->text);
}
public function jsonSerialize(): mixed { public function jsonSerialize(): mixed {
// Only used for passing to DOM // Only used for passing to DOM
$details = get_object_vars($this); $details = get_object_vars($this);
$details['text'] = html_sanitize($details['text']); $details['text'] = html_sanitize($this->get_text());
$details['description'] = html_sanitize($details['description']); $details['description'] = html_sanitize($details['description']);
$details['type'] = $this->get_tag_type(); $details['type'] = $this->get_tag_type();
return $details; return $details;

@ -101,7 +101,7 @@
class="room-label <?=$tag->get_tag_classname()?> badge" class="room-label <?=$tag->get_tag_classname()?> badge"
title="<?=$tag->description?>" title="<?=$tag->description?>"
><?= ><?=
truncate($tag->text, 16) truncate($tag->get_text(), 16)
?></span> ?></span>
<?php endif; endforeach; ?> <?php endif; endforeach; ?>
</span> </span>

Loading…
Cancel
Save