]> 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>
Thu, 6 May 2010 21:48:12 +0000 (21:48 +0000)
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 b3cfb281383568b200abe083810a560339781274..875bcaa020b91a5c55b37b6333a16274a186c794 100644 (file)
@@ -1221,7 +1221,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 2608be227a4f5d09c8a5ed865ac2afc766c8e351..42aa08ef7d0fed8c97ccf2816e95333eaabd1568 100644 (file)
@@ -319,13 +319,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;