<div dir="ltr"><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">I've installed your version and it seems to work without problems. Thank You!</div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">jürgen<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Do., 23. Juni 2022 um 14:02 Uhr schrieb Petko Yotov <<a href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks, I've updated the recipe on the cookbook:<br>
<br>
<a href="https://www.pmwiki.org/wiki/Cookbook/ImageMap" rel="noreferrer" target="_blank">https://www.pmwiki.org/wiki/Cookbook/ImageMap</a><br>
<br>
The update is a little different from your suggestion, includes some <br>
refactoring and improvements for links, and should work at least until <br>
PHP 8.1.<br>
<br>
If you find any problems with the new recipe on existing PmWiki markup, <br>
please let me know.<br>
<br>
Petko<br>
<br>
-- <br>
If you upgrade : <a href="https://www.pmwiki.org/Upgrades" rel="noreferrer" target="_blank">https://www.pmwiki.org/Upgrades</a><br>
<br>
<br>
На 22/06/2022 15:02, Hans-Jürgen Godau написа:<br>
> While using imagemap.php from the cookbook I had to change the code<br>
> because of Warnings/Errors shown by php:<br>
> <br>
> --- imagemap.php 2022-06-21 17:42:57.389642705 +0200<br>
> +++ imagemap.php.new 2022-06-22 13:47:31.360706020 +0200<br>
> @@ -49,17 +49,22 @@<br>
> Markup('area', 'directives', "/\\(:area (.*?)?\\s*?:\\)/",<br>
> "MapArea");<br>
> function MapArea($m) {<br>
> global $ScriptUrl, $EnablePathInfo, $EnableOnclickJavascripting;<br>
> - $arg = PSS(ParseArgs($m[1]));<br>
> - if (isset($arg['href'])) {<br>
> + $out="";<br>
> + if (is_array($m) && array_key_exists(1,$m)) {<br>
> + /* $arg = ParseArgs($m[1]); */<br>
> + $arg = ParseArgs(PSS($m[1]));<br>
> + if (isset($arg['href'])) {<br>
> $tgt = $arg['href'];<br>
> if($EnablePathInfo) $LinkUrl = $ScriptUrl."/".$tgt;<br>
> else $LinkUrl = $ScriptUrl."?n=".$tgt;<br>
> - preg_match("/(http:)(.*?)/",$tgt,$m);<br>
> - if($m[1]) $LinkUrl = $tgt;<br>
> - preg_match("/(#)(.*?)/",$tgt,$m);<br>
> - if($m[1]) $LinkUrl = $tgt;<br>
> + if (preg_match("/(http:)(.*?)/",$tgt,$m)) {<br>
> + if($m[1]) $LinkUrl = $tgt;<br>
> + }<br>
> + if (preg_match("/(#)(.*?)/",$tgt,$m)) {<br>
> + if($m[1]) $LinkUrl = $tgt;<br>
> + }<br>
> }<br>
> - $out = "<area ";<br>
> + $out .= "<area ";<br>
> if (isset($arg['shape']))<br>
> $out .= " shape='".$arg['shape']."'";<br>
> if (isset($arg['coords']))<br>
> @@ -77,5 +82,7 @@<br>
> if (isset($arg['onclick']))<br>
> $out .= " onclick='".$arg['onclick']."'"; }<br>
> $out .= " />";<br>
> + }<br>
> return Keep($out);<br>
> +<br>
> }<br>
> ============================<br>
> Maybe you could adjust the imagemap.php code?<br>
> <br>
> Thanks,<br>
> H.-Jürgen Godau<br>
> _______________________________________________<br>
> pmwiki-users mailing list<br>
> <a href="mailto:pmwiki-users@pmichaud.com" target="_blank">pmwiki-users@pmichaud.com</a><br>
> <a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" rel="noreferrer" target="_blank">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a><br>
</blockquote></div>