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

Commit 0dfef88c authored by Zach Copley's avatar Zach Copley

HTML entity encode source link URLs in plain XML output and add rel="nofollow" to them

parent 68634f04
......@@ -349,7 +349,7 @@ class TwitapisearchatomAction extends ApiAction
$ns = $notice->getSource();
if ($ns) {
if (!empty($ns->name) && !empty($ns->url)) {
$source = '<a href="' . $ns->url . '">' . $ns->name . '</a>';
$source = '<a href="' . $ns->url . '" rel="nofollow">' . $ns->name . '</a>';
} else {
$source = $ns->code;
}
......
......@@ -266,13 +266,13 @@ class ApiAction extends Action
$ns = $notice->getSource();
if ($ns) {
if (!empty($ns->name) && !empty($ns->url)) {
$source = '<a href="' . $ns->url . '">' . $ns->name . '</a>';
$source = '<a href="' . $ns->url . '" rel="nofollow">' . $ns->name . '</a>';
} else {
$source = $ns->code;
}
}
$twitter_status['source'] = $source;
$twitter_status['source'] = htmlentities($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