# HG changeset patch # User Matti Hamalainen # Date 1431696810 -10800 # Node ID 1bf73b49fc91de60bd35005e99acffe9906332d7 # Parent 014e1d6991a30a97f248e63c12a0c34ea4737a78 Beautify the generated URLs by removing occurences of duplicate forward slash //. diff -r 014e1d6991a3 -r 1bf73b49fc91 mgallery.php --- a/mgallery.php Fri May 15 16:29:38 2015 +0300 +++ b/mgallery.php Fri May 15 16:33:30 2015 +0300 @@ -13,7 +13,7 @@ function mgGetImageURL() { global $galImageURL, $galPath; - return $galImageURL.$galPath."/".implode("", func_get_args()); + return str_replace("//", "/", $galImageURL.$galPath."/".implode("", func_get_args())); } @@ -24,14 +24,16 @@ if ($galCleanURLS) { - return $galBaseURL.$path."/".($image !== FALSE ? $image : ""); + $url = $galBaseURL.$path."/".($image !== FALSE ? $image : ""); } else { - return + $url = $galBaseURL.mgGetSetting("mgallery_php")."?path=". $path.($image !== FALSE ? $amp."image=".$image : ""); } + + return str_replace("//", "/", $url); }