]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Remove errant double HTML entity encoding in API source attribution
authorZach Copley <zach@status.net>
Thu, 6 May 2010 21:36:13 +0000 (21:36 +0000)
committerZach Copley <zach@status.net>
Tue, 18 May 2010 22:16:23 +0000 (15:16 -0700)
actions/twitapisearchatom.php
classes/Notice.php
lib/apiaction.php

index 6c740c4902289270440095f98f4b07b4ffa4aa16..51e8a8881bf2730646da314f0ebcb16729465c07 100644 (file)
@@ -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');
 
index 1965012797f6f8c6917490b83d999b571d57edbe..0dc7e10e79e6ee131107f75c9f54d7b907766743 100644 (file)
@@ -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;
                 }
             }
 
index f3efff40212abc0d03123157c806178829692fb8..68198effc9ed2f4d9ec633f9e2d689d0bd4f2b46 100644 (file)
@@ -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;