Browse Source

fixed anchor in url (#1858)

CauseFX 3 năm trước cách đây
mục cha
commit
52e158700d
1 tập tin đã thay đổi với 10 bổ sung6 xóa
  1. 10 6
      api/functions/normal-functions.php

+ 10 - 6
api/functions/normal-functions.php

@@ -439,22 +439,26 @@ trait NormalFunctions
 			$scheme = $digest['scheme'];
 		}
 		// Host
-		$host = (isset($digest['host']) ? $digest['host'] : '');
+		$host = ($digest['host'] ?? '');
 		// Port
 		$port = (isset($digest['port']) ? ':' . $digest['port'] : '');
 		// Path
-		$path = (isset($digest['path']) ? $digest['path'] : '');
+		$path = ($digest['path'] ?? '');
 		// Query
 		$query = (isset($digest['query']) ? '?' . $digest['query'] : '');
+		// Fragment
+		$fragment = (isset($digest['fragment']) ? '#' . $digest['fragment'] : '');
 		// Output
-		$array = array(
+		$array = [
 			'scheme' => $scheme,
 			'host' => $host,
 			'port' => $port,
 			'path' => $path,
-			'query' => $query
-		);
-		return ($return) ? $array : $scheme . '://' . $host . $port . $path . $query;
+			'query' => $query,
+			'fragment' => $fragment,
+			'digest' => $digest
+		];
+		return ($return) ? $array : $scheme . '://' . $host . $port . $path . $query . $fragment;
 	}
 
 	public function getServer($over = false)