summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2016-02-20 12:06:47 +0300
committerAndrew Dolgov <[email protected]>2016-02-20 12:06:47 +0300
commit94d425fe4a21d41737fe656d9c54c38775fbd132 (patch)
treecde3443a95fb7ea75e867bd823f642333e103bcc /include
parent7bbe94bc93faed5118f2044de96ca2698c3e09eb (diff)
rewrite_relative_url: only skip urls like magnet: instead of everything with :
Diffstat (limited to 'include')
-rw-r--r--include/functions2.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/functions2.php b/include/functions2.php
index ed22a0623..811c72ee3 100644
--- a/include/functions2.php
+++ b/include/functions2.php
@@ -2048,15 +2048,15 @@
* @return string Absolute URL
*/
function rewrite_relative_url($url, $rel_url) {
- if (strpos($rel_url, ":") !== false) {
- return $rel_url;
- } else if (strpos($rel_url, "://") !== false) {
+ if (strpos($rel_url, "://") !== false) {
return $rel_url;
} else if (strpos($rel_url, "//") === 0) {
# protocol-relative URL (rare but they exist)
return $rel_url;
- } else if (strpos($rel_url, "/") === 0)
- {
+ } else if (preg_match("/^[a-z]+:/i", $rel_url)) {
+ # magnet:, feed:, etc
+ return $rel_url;
+ } else if (strpos($rel_url, "/") === 0) {
$parts = parse_url($url);
$parts['path'] = $rel_url;