changeset 28:2d8112d6c3bc

Fix relative links re-parsing.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 16 Jan 2016 02:18:10 +0200
parents b8f8e03f943b
children 8cf743c7ea23
files mgallery.php
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mgallery.php	Sat Jan 16 02:17:49 2016 +0200
+++ b/mgallery.php	Sat Jan 16 02:18:10 2016 +0200
@@ -441,9 +441,9 @@
         if (preg_match("@^[a-z]+://@i", $mstmp) === 0)
         {
           if ($mstmp[0] != "/")
-            $mstmp = $baseURL."/".$galPath."/".$mstmp;
+            $mstmp = $baseURL."/".$galPath."/".str_replace("//", "/", $mstmp);
         }
-        return "href=\"".str_replace("//", "/", $mstmp)."\"";
+        return "href=\"".$mstmp."\"";
       },
       $galData["header"]);