We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 5ea019c4 authored by Zach Copley's avatar Zach Copley

Remove errant double HTML entity encoding in API source attribution

parent 37083418
......@@ -349,14 +349,17 @@ class TwitapisearchatomAction extends ApiAction
$ns = $notice->getSource();
if ($ns) {
if (!empty($ns->name) && !empty($ns->url)) {
$source = '<a href="' . $ns->url . '" rel="nofollow">' . $ns->name . '</a>';
$source = '<a href="'
. htmlspecialchars($ns->url)
. '" rel="nofollow">'
. htmlspecialchars($ns->name)
. '</a>';
} else {
$source = $ns->code;
}
}
$this->element("twitter:source", null,
htmlentities($source));
$this->element("twitter:source", null, $source);
$this->elementStart('author');
......
......@@ -1220,7 +1220,7 @@ class Notice extends Memcached_DataObject
$ns = $this->getSource();
if ($ns) {
if (!empty($ns->url)) {
$noticeInfoAttr['source_link'] = htmlentities($ns->url);
$noticeInfoAttr['source_link'] = $ns->url;
}
}
......
......@@ -266,13 +266,17 @@ class ApiAction extends Action
$ns = $notice->getSource();
if ($ns) {
if (!empty($ns->name) && !empty($ns->url)) {
$source = '<a href="' . $ns->url . '" rel="nofollow">' . $ns->name . '</a>';
$source = '<a href="'
. htmlspecialchars($ns->url)
. '" rel="nofollow">'
. htmlspecialchars($ns->name)
. '</a>';
} else {
$source = $ns->code;
}
}
$twitter_status['source'] = htmlentities($source);
$twitter_status['source'] = $source;
$twitter_status['id'] = intval($notice->id);
$replier_profile = null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment