]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Always specify UTF-8 targt charset for html_entity_decode(); default is 8-bit ISO...
authorBrion Vibber <brion@pobox.com>
Thu, 30 Sep 2010 18:29:31 +0000 (11:29 -0700)
committerBrion Vibber <brion@pobox.com>
Thu, 30 Sep 2010 18:29:31 +0000 (11:29 -0700)
lib/activityobject.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/TwitterBridge/daemons/twitterstatusfetcher.php
scripts/importtwitteratom.php
scripts/install_cli.php
scripts/restoreuser.php

index 95615d581c8266537e02f1145176b08a048d9b2e..c957933d04bff8c2e11ba75552e58faeaabe4b81 100644 (file)
@@ -203,7 +203,7 @@ class ActivityObject
 
         $title = ActivityUtils::childHtmlContent($element, self::TITLE);
 
-        $this->title = html_entity_decode(strip_tags($title));
+        $this->title = html_entity_decode(strip_tags($title), ENT_QUOTES, 'UTF-8');
 
         $this->source  = $this->_getSource($element);
 
index 047435f6687acf1cc0f517809c1d06921d92fb3c..10cee917e1163a906d94b8d3a25ce7749c794a1a 100644 (file)
@@ -558,7 +558,7 @@ class Ostatus_profile extends Memcached_DataObject
         // Get (safe!) HTML and text versions of the content
 
         $rendered = $this->purify($sourceContent);
-        $content = html_entity_decode(strip_tags($rendered));
+        $content = html_entity_decode(strip_tags($rendered), ENT_QUOTES, 'UTF-8');
 
         $shortened = common_shorten_links($content);
 
@@ -569,7 +569,7 @@ class Ostatus_profile extends Memcached_DataObject
 
         if (Notice::contentTooLong($shortened)) {
             $attachment = $this->saveHTMLFile($note->title, $rendered);
-            $summary = html_entity_decode(strip_tags($note->summary));
+            $summary = html_entity_decode(strip_tags($note->summary), ENT_QUOTES, 'UTF-8');
             if (empty($summary)) {
                 $summary = $content;
             }
index 590fa2954d1ac467c65d2f23a97917a9b1ef59e6..cef67b18060c9b952e1263ed7176423f1044e651 100755 (executable)
@@ -321,7 +321,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
 
         $notice->is_local   = Notice::GATEWAY;
 
-        $notice->content  = html_entity_decode($status->text);
+        $notice->content  = html_entity_decode($status->text, ENT_QUOTES, 'UTF-8');
         $notice->rendered = $this->linkify($status);
 
         if (Event::handle('StartNoticeSave', array(&$notice))) {
index 261dfb1d02b7af595d628632eec97f1af2947cb4..a29526f27e1726f57f3679dcdab034fbf4350614 100644 (file)
@@ -89,7 +89,7 @@ function importActivityStream($user, $doc)
 
         $html = htmLawed($html, $config);
 
-        $content = html_entity_decode(strip_tags($html));
+        $content = html_entity_decode(strip_tags($html), ENT_QUOTES, 'UTF-8');
 
         $notice = Notice::saveNew($user->id,
                                   $content,
index 61fbe18ef641fcaa9bd54ce8542f5e8d3b0d3e20..dadbcf66f0e80329aeb95776ba9b4a0c080fc003 100755 (executable)
@@ -208,7 +208,7 @@ END_HELP;
         $breakout = preg_replace('/<a[^>+]\bhref="(.*)"[^>]*>(.*)<\/a>/',
                                  '\2 &lt;\1&gt;',
                                  $html);
-        return html_entity_decode(strip_tags($breakout));
+        return html_entity_decode(strip_tags($breakout), ENT_QUOTES, 'UTF-8');
     }
 }
 
index de3816dd535b96fc63fe3b748f7295f3810dee2c..82eb9bbaa17ad01aae418458bbf66c23e6e278c8 100644 (file)
@@ -213,7 +213,7 @@ function postNote($user, $activity)
     // Get (safe!) HTML and text versions of the content
 
     $rendered = purify($sourceContent);
-    $content = html_entity_decode(strip_tags($rendered));
+    $content = html_entity_decode(strip_tags($rendered), ENT_QUOTES, 'UTF-8');
 
     $shortened = common_shorten_links($content);