Browse Source

atom: only perform xml:base based rewriting if base element exists (closes #761)

Andrew Dolgov 7 years ago
parent
commit
491ef97072
1 changed files with 5 additions and 1 deletions
  1. 5 1
      classes/feeditem/atom.php

+ 5 - 1
classes/feeditem/atom.php

@@ -42,7 +42,11 @@ class FeedItem_Atom extends FeedItem_Common {
 					|| $link->getAttribute("rel") == "standout")) {
 				$base = $this->xpath->evaluate("string(ancestor-or-self::*[@xml:base][1]/@xml:base)", $link);
 
-				return rewrite_relative_url($base, $link->getAttribute("href"));
+				if ($base)
+					return rewrite_relative_url($base, $link->getAttribute("href"));
+				else
+					return $link->getAttribute("href");
+
 			}
 		}
 	}