1
1
Fork 0

Correct self attribute in ATOM feeds

Fix for
https://github.com/friendica/friendica/issues/6128#issuecomment-439016471
Special case for DFRN to reduce the risk of unintended side effects
This commit is contained in:
Alexandre Alapetite 2018-11-16 18:54:06 +01:00
parent 58e35f037b
commit 97d164f69e

View file

@ -1320,7 +1320,13 @@ class OStatus
$attributes = ["href" => System::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-mention"];
XML::addElement($doc, $root, "link", "", $attributes);
$attributes = ["href" => System::baseUrl() . "/dfrn_poll/" . $owner["nick"],
if (empty($_SERVER['REQUEST_URI']) || strpos($_SERVER['REQUEST_URI'], '/dfrn_poll/') !== false) {
$selfUri = "/dfrn_poll/" . $owner["nick"];
} else {
$selfUri = $_SERVER['REQUEST_URI'];
}
$attributes = ["href" => System::baseUrl() . $selfUri,
"rel" => "self", "type" => "application/atom+xml"];
XML::addElement($doc, $root, "link", "", $attributes);