X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/2dc4984ad57dfcb0ded829bfc9d45493484fe6e3..db2c9c7773cd5d14b732689b2e844e62d2773be5:/lib/functions.php diff --git a/lib/functions.php b/lib/functions.php index eaedfac..3a50eac 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -597,7 +597,7 @@ function jirafeau_admin_list($name, $file_hash, $link_hash) } /* Filter. */ - if (!empty($name) && !preg_match("/$name/i", htmlspecialchars($l['file_name']))) { + if (!empty($name) && !preg_match("/$name/i", jirafeau_escape($l['file_name']))) { continue; } if (!empty($file_hash) && $file_hash != $l['md5']) { @@ -609,10 +609,10 @@ function jirafeau_admin_list($name, $file_hash, $link_hash) /* Print link informations. */ echo ''; echo '' . - '' . htmlspecialchars($l['file_name']) . ''; + '' . jirafeau_escape($l['file_name']) . ''; echo ''; - echo '' . $l['mime_type'] . ''; + echo '' . jirafeau_escape($l['mime_type']) . ''; echo '' . jirafeau_human_size($l['file_size']) . ''; echo '' . ($l['time'] == -1 ? '∞' : jirafeau_get_datetimefield($l['time'])) . ''; echo ''; @@ -1243,3 +1243,8 @@ function jirafeau_replace_markers($content, $htmllinebreaks = false) return $content; } + +function jirafeau_escape($string) +{ + return htmlspecialchars($string, ENT_QUOTES); +}