Skip to content

Commit

Permalink
Escape breadcrumb titles (#186)
Browse files Browse the repository at this point in the history
Titles containing non-alphanumeric characters can break the layout or
formatting when rendered in breadcrumbs. Escaping them on output with
html entities fixes this for existing and future titles.
  • Loading branch information
ThomasBrierley authored Sep 27, 2024
1 parent 02b19b8 commit 0bd5c98
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lti/store/details.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
<div class="header-back-nav">
<ol class="breadcrumb">
<li><a href="../index.php">Store</a></li>
<li class="active"><?= $title ?></li>
<li class="active"><?= htmlent_utf8($title) ?></li>
</ol>
</div>
<div class="detail-header">
Expand Down
2 changes: 1 addition & 1 deletion lti/store/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
<div class="header-back-nav">
<ol class="breadcrumb">
<li><a href="../index.php">Store</a></li>
<li><a href="<?= $rest_path->parent ?>/details/<?= urlencode($install) ?>"><?= $title; ?></a></li>
<li><a href="<?= $rest_path->parent ?>/details/<?= urlencode($install) ?>"><?= htmlent_utf8($title); ?></a></li>
<li class="active">Try It</li>
</ol>
</div>
Expand Down
2 changes: 1 addition & 1 deletion store/details.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
<div class="header-back-nav">
<ol class="breadcrumb">
<li><a href="<?= $rest_path->parent; ?>">Store</a></li>
<li class="active"><?= $title ?></li>
<li class="active"><?= htmlent_utf8($title) ?></li>
</ol>
</div>
<div class="detail-header">
Expand Down
2 changes: 1 addition & 1 deletion store/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<div class="header-back-nav">
<ol class="breadcrumb">
<li><a href="<?= $rest_path->parent; ?>">Store</a></li>
<li><a href="<?= $rest_path->parent ?>/details/<?= urlencode($install) ?>"><?= $title; ?></a></li>
<li><a href="<?= $rest_path->parent ?>/details/<?= urlencode($install) ?>"><?= htmlent_utf8($title); ?></a></li>
<li class="active">Try It</li>
</ol>
</div>
Expand Down

0 comments on commit 0bd5c98

Please sign in to comment.