4
0
Эх сурвалжийг харах

Fix whitespace in URL's (#1116 & #1117) - again

causefx 7 жил өмнө
parent
commit
5e3c9d2052

+ 2 - 2
api/functions/normal-functions.php

@@ -392,7 +392,7 @@ function qualifyURL($url, $return = false)
 		$url = $protocol . getServer() . $url;
 	}
 	// Get Digest
-	$digest = parse_url(preg_replace('/\s+/', '', $url));
+	$digest = parse_url(rtrim(preg_replace('/\s+/', '', $url), '/'));
 	// http/https
 	if (!isset($digest['scheme'])) {
 		if (isset($digest['port']) && in_array($digest['port'], array(80, 8080, 8096, 32400, 7878, 8989, 8182, 8081, 6789))) {
@@ -408,7 +408,7 @@ function qualifyURL($url, $return = false)
 	// Port
 	$port = (isset($digest['port']) ? ':' . $digest['port'] : '');
 	// Path
-	$path = (isset($digest['path']) && $digest['path'] !== '/' ? $digest['path'] : '');
+	$path = (isset($digest['path']) ? $digest['path'] : '');
 	// Output
 	$array = array(
 		'scheme' => $scheme,