Skip to content

Commit

Permalink
fix: Check languageName exists before printing in keyboard details
Browse files Browse the repository at this point in the history
  • Loading branch information
darcywong00 committed Nov 25, 2024
1 parent 501e187 commit 52ffa50
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions _includes/includes/ui/keyboard-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,13 @@ protected static function WriteKeyboardDetails() {
echo " <a id='expand-languages' href='#expand-languages'>Expand $count more &gt;&gt;</a>";
echo "<a id='collapse-languages' href='#collapse-languages'>&lt;&lt; Collapse</a> <span class='expand-languages'>";
}
echo
"<a href='/keyboards?q=l:id:".htmlspecialchars(rawurlencode($bcp47)).
"' title='".htmlspecialchars($bcp47).": ".htmlspecialchars($detail->displayName)."'>" .
(!strcasecmp($bcp47, self::$bcp47) ? "<mark>".htmlspecialchars($detail->languageName)."</mark>" : htmlspecialchars($detail->languageName)).
"</a> ";
if (array_key_exists('languageName', $detail)) {
echo
"<a href='/keyboards?q=l:id:".htmlspecialchars(rawurlencode($bcp47)).
"' title='".htmlspecialchars($bcp47).": ".htmlspecialchars($detail->displayName)."'>" .
(!strcasecmp($bcp47, self::$bcp47) ? "<mark>".htmlspecialchars($detail->languageName)."</mark>" : htmlspecialchars($detail->languageName)).
"</a> ";
}
$n++;
}
if($n >= 3) {
Expand Down

0 comments on commit 52ffa50

Please sign in to comment.