From 7ba6beb745e583f5abbfb5b38eaefeb98c762e9a Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 20 Dec 2018 23:59:38 -0100 Subject: [PATCH] htmlentities encode/decode Signed-off-by: Maxence Lange --- lib/Model/ActivityPub/ACore.php | 1 + lib/Service/PostService.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Model/ActivityPub/ACore.php b/lib/Model/ActivityPub/ACore.php index 0a177126..94b49a09 100644 --- a/lib/Model/ActivityPub/ACore.php +++ b/lib/Model/ActivityPub/ACore.php @@ -468,6 +468,7 @@ class ACore extends Item implements JsonSerializable { case self::AS_STRING: $value = strip_tags($value); + $value = html_entity_decode($value, ENT_QUOTES); return $value; diff --git a/lib/Service/PostService.php b/lib/Service/PostService.php index 46cb1794..b2f39ac8 100644 --- a/lib/Service/PostService.php +++ b/lib/Service/PostService.php @@ -85,9 +85,9 @@ class PostService { public function createPost(Post $post, ACore &$activity = null): string { $note = $this->noteService->generateNote( - $post->getUserId(), $post->getContent(), $post->getType() + $post->getUserId(), htmlentities($post->getContent(), ENT_QUOTES), $post->getType() ); - + $this->noteService->replyTo($note, $post->getReplyTo()); $this->noteService->addRecipients($note, $post->getType(), $post->getTo());