]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #4596 from annando/attachment-encode
authorHypolite Petovan <mrpetovan@gmail.com>
Wed, 14 Mar 2018 22:59:25 +0000 (18:59 -0400)
committerGitHub <noreply@github.com>
Wed, 14 Mar 2018 22:59:25 +0000 (18:59 -0400)
Attachment encode

src/Content/Text/BBCode.php

index 9eb5cfd72453b6a46ab89c7ba6d77578d6e0adec..532397c13acca4a98de6e1dbd7e95a0ec2a3f4a5 100644 (file)
@@ -25,6 +25,7 @@ use Friendica\Util\ParseUrl;
 
 require_once "include/event.php";
 require_once "include/html2plain.php";
+require_once "include/html2bbcode.php";
 require_once "mod/proxy.php";
 
 class BBCode
@@ -705,9 +706,10 @@ class BBCode
                                }
 
                                if ($data["description"] != "" && $data["description"] != $data["title"]) {
-                                       $return .= sprintf('<blockquote>%s</blockquote>', trim(BBCode::convert($data["description"])));
+                                       // Sanitize the HTML by converting it to BBCode
+                                       $bbcode = html2bbcode($data["description"]);
+                                       $return .= sprintf('<blockquote>%s</blockquote>', trim(self::convert($bbcode)));
                                }
-
                                if ($data["type"] == "link") {
                                        $return .= sprintf('<sup><a href="%s">%s</a></sup>', $data['url'], parse_url($data['url'], PHP_URL_HOST));
                                }