diff --git a/QvitterPlugin.php b/QvitterPlugin.php index 0522859..b0d176a 100644 --- a/QvitterPlugin.php +++ b/QvitterPlugin.php @@ -519,9 +519,10 @@ class QvitterPlugin extends Plugin { $oembed = File_oembed::getKV('file_id',$attachment->id); if($oembed instanceof File_oembed) { $oembed_html = str_replace('<!--//-->','',$oembed->html); // trash left of wordpress' javascript after htmLawed removed the tags - if($oembed->provider == 'Twitter' && strstr($oembed_html, '
—')) { - $oembed_html = substr($oembed_html,0,strpos($oembed_html, '
—')); // remove user data from twitter oembed html (we have it in ) - $twitter_username = substr($oembed->html,strpos($oembed->html, '
—')+12); +error_log('$oembed_html: '.$oembed_html); + if($oembed->provider == 'Twitter' && strstr($oembed_html, '>— '.$oembed->author_name)) { + $oembed_html = substr($oembed_html,0,strpos($oembed_html, '>— '.$oembed->author_name)+1); // remove user data from twitter oembed html (we have it in ) + $twitter_username = substr($oembed->html,strpos($oembed->html, '>— '.$oembed->author_name)+strlen('>— '.$oembed->author_name)); $twitter_username = substr($twitter_username, strpos($twitter_username,'(@')+1); $twitter_username = substr($twitter_username, 0,strpos($twitter_username,')')); $oembed->title = $twitter_username;