# HG changeset patch # User Matti Hamalainen # Date 1521466935 -7200 # Node ID 39f50d08ec509f9ff342aa1642ce92fd48bef23b # Parent d03fad24f4bc3e62e8bde5f549b2a71fedefc887 Fix quoting of image element alt texts. diff -r d03fad24f4bc -r 39f50d08ec50 mgallery.php --- a/mgallery.php Mon Mar 19 15:29:54 2018 +0200 +++ b/mgallery.php Mon Mar 19 15:42:15 2018 +0200 @@ -103,6 +103,12 @@ } +function dhentities($str) +{ + return htmlentities($str, ENT_COMPAT, "UTF-8"); +} + + function mgMangleURI($filename) { global $pageDebug; @@ -276,7 +282,7 @@ "
\"".chentities($filename)."\"
\n". + "\" alt=\"".dhentities($filename)."\">\n". mgGetArr($data, "caption", "
%1
\n", "", "chentities"); /* if ($mode == "") @@ -319,7 +325,7 @@ echo " ". "\"".\n". "
".mgGetTrans($data["caption"], TRUE)."
\n"; }