- // Remove leading slash from REQUEST_URI.
- $data['self_link'] = escape(server_url($this->serverInfo))
- . escape($this->serverInfo['REQUEST_URI']);
+ // Remove leading path from REQUEST_URI (already contained in $pageaddr).
+ $requestUri = preg_replace('#(.*?/)(feed.*)#', '$2', escape($this->serverInfo['REQUEST_URI']));
+ $data['self_link'] = $pageaddr . $requestUri;