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

This commit is contained in:
Zach Copley 2010-05-06 00:55:17 -07:00
parent 292ea33dbd
commit 209fd12cd0
2 changed files with 3 additions and 3 deletions

View File

@ -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;
}

View File

@ -319,13 +319,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;