]> git.mxchange.org Git - friendica.git/commitdiff
Add quote support in attachment title in ActivityPub\Processor
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 9 Jun 2020 12:53:48 +0000 (08:53 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 9 Jun 2020 12:53:48 +0000 (08:53 -0400)
src/Protocol/ActivityPub/Processor.php

index 0c60ca57d90a2f6f3d2b64610ad179d6bc4e472b..1765b4701732b2a64aaa96a73f1e6b7e14d3ca5f 100644 (file)
@@ -103,7 +103,7 @@ class Processor
                                                // Additional link attachments are prepended before the existing [attachment] tag
                                                $item['body'] = substr_replace($item['body'], "\n[bookmark=" . $attach['url'] . ']' . $linkTitle . "[/bookmark]\n", $existingAttachmentPos, 0);
                                        } else {
-                                               $item['body'] .= "\n[attachment type='link' url='" . $attach['url'] . "' title='" . ($attach['title'] ?? '') . "' image='" . ($attach['image'] ?? '') . "']" . ($attach['desc'] ?? '') . '[/attachment]';
+                                               $item['body'] .= "\n[attachment type='link' url='" . $attach['url'] . "' title='" . htmlspecialchars($attach['title'] ?? '', ENT_QUOTES) . "' image='" . ($attach['image'] ?? '') . "']" . ($attach['desc'] ?? '') . '[/attachment]';
                                        }
                                        break;
                                default: