Skip to content

Commit

Permalink
quotes as constant
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Dec 30, 2021
1 parent 7aec5bd commit 1f4eb7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lhc_web/lib/core/lhcore/lhdesign.php
Expand Up @@ -408,7 +408,7 @@ public static function mb_wordwrap($str, $width = 75, $break = "\n", $cut = fals
return implode($break, $lines);
}

public static function shrt($string = '', $max = 10, $append = '...', $wordrap = 30, $encQuates = null)
public static function shrt($string = '', $max = 10, $append = '...', $wordrap = 30, $encQuates = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401)
{
$string = str_replace(' ', ' ', $string);
$string = str_replace(array(
Expand All @@ -426,8 +426,10 @@ public static function shrt($string = '', $max = 10, $append = '...', $wordrap =

$string = self::mb_wordwrap($string, $wordrap, "\n", true);

if (mb_strlen($string) <= $max)
if (mb_strlen($string) <= $max) {
return htmlspecialchars($string, $encQuates);
}

$cutted = mb_strcut($string, 0, $max, 'UTF-8') . $append;

return htmlspecialchars($cutted, $encQuates);
Expand Down

0 comments on commit 1f4eb7c

Please sign in to comment.