comparison mgallery.php @ 200:39f50d08ec50

Fix quoting of image element alt texts.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 19 Mar 2018 15:42:15 +0200
parents d03fad24f4bc
children c8b69b6bb692
comparison
equal deleted inserted replaced
199:d03fad24f4bc 200:39f50d08ec50
98 98
99 99
100 function chentities($str) 100 function chentities($str)
101 { 101 {
102 return htmlentities($str, ENT_NOQUOTES, "UTF-8"); 102 return htmlentities($str, ENT_NOQUOTES, "UTF-8");
103 }
104
105
106 function dhentities($str)
107 {
108 return htmlentities($str, ENT_COMPAT, "UTF-8");
103 } 109 }
104 110
105 111
106 function mgMangleURI($filename) 112 function mgMangleURI($filename)
107 { 113 {
274 { 280 {
275 echo 281 echo
276 " <div class=\"imageBox\" title=\"".mgGetImageTitleStr($filename, $data). 282 " <div class=\"imageBox\" title=\"".mgGetImageTitleStr($filename, $data).
277 "\"><a href=\"".mgGetURL($galPath, $filename)."\"><img src=\"". 283 "\"><a href=\"".mgGetURL($galPath, $filename)."\"><img src=\"".
278 mgGetImageURL($galTNPath, $filename). 284 mgGetImageURL($galTNPath, $filename).
279 "\" alt=\"".chentities($filename)."\"></a></div>\n". 285 "\" alt=\"".dhentities($filename)."\"></a></div>\n".
280 mgGetArr($data, "caption", " <div class=\"imageCaption\">%1</div>\n", "", "chentities"); 286 mgGetArr($data, "caption", " <div class=\"imageCaption\">%1</div>\n", "", "chentities");
281 /* 287 /*
282 if ($mode == "") 288 if ($mode == "")
283 { 289 {
284 echo 290 echo
317 $atmp = $galAlbumIcon; 323 $atmp = $galAlbumIcon;
318 324
319 echo 325 echo
320 " <a href=\"".mgGetURL(mgCleanPath(TRUE, $galPath, $filename), FALSE)."\">". 326 " <a href=\"".mgGetURL(mgCleanPath(TRUE, $galPath, $filename), FALSE)."\">".
321 "<img class=\"albumIcon\" src=\"".$atmp."\" alt=\"". 327 "<img class=\"albumIcon\" src=\"".$atmp."\" alt=\"".
322 mgGetTrans($data["caption"], TRUE). 328 dhentities(mgGetTrans($data["caption"], TRUE)).
323 "\" />\n". 329 "\" />\n".
324 " <div class=\"albumTitle\">".mgGetTrans($data["caption"], TRUE)."</div></a>\n"; 330 " <div class=\"albumTitle\">".mgGetTrans($data["caption"], TRUE)."</div></a>\n";
325 } 331 }
326 332
327 if ($galUseTables) 333 if ($galUseTables)