From 5101cf22b25aba394b5c436ad6c63b005dbdaff0 Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Sat, 23 Jan 2016 00:31:13 +0100 Subject: [PATCH] convert single quotes also (escaped by js later, this avoids double escaping) --- QvitterPlugin.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/QvitterPlugin.php b/QvitterPlugin.php index 96a6102..7e6c362 100644 --- a/QvitterPlugin.php +++ b/QvitterPlugin.php @@ -528,15 +528,17 @@ class QvitterPlugin extends Plugin { $oembed->title = $twitter_username; } $oembed_html = str_replace('…','...',$oembed_html); // ellipsis is sometimes stored as html in db, for some reason - $oembed_html = trim(strip_tags(html_entity_decode($oembed_html))); // sometimes we have html charachters that we want to decode and then strip - $oembed_title = trim(strip_tags(html_entity_decode($oembed->title))); + $oembed_html = substr(trim(strip_tags(html_entity_decode($oembed_html,ENT_QUOTES))),0,250); // sometimes we have html charachters that we want to decode and then strip + $oembed_title = trim(strip_tags(html_entity_decode($oembed->title,ENT_QUOTES))); + $oembed_provider = trim(strip_tags(html_entity_decode($oembed->provider,ENT_QUOTES))); + $oembed_author_name = trim(strip_tags(html_entity_decode($oembed->author_name,ENT_QUOTES))); $attachment_url_to_id[$enclosure_o->url]['oembed'] = array( 'type'=> $oembed->type, - 'provider'=> $oembed->provider, + 'provider'=> $oembed_provider, 'provider_url'=> $oembed->provider_url, 'oembedHTML'=> $oembed_html, 'title'=> $oembed_title, - 'author_name'=> $oembed->author_name, + 'author_name'=> $oembed_author_name, 'author_url'=> $oembed->author_url ); } else {