From d7ff8b9ac77b694bb7212862993de4d7dc25d83c Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 5 Jul 2017 18:29:11 +0200 Subject: [PATCH] [TwitterBridge] Fix title includes anchors in plaintext format The title attribute includes tags (anchors) instead of raw text. While this works fine in a browser, using a raw format like plain- text or json breaks with expected behavior. This commit changes the order in which functions are applied. By re- moving anchors AFTER fixing the title, the final result does not include tags and the title is still fixed. This bug was introduced by d81b61ccfa19e2c685df7acfb7c4306b7b775846 References: #546 --- bridges/TwitterBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index fdb24b2..64fb653 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -122,7 +122,7 @@ class TwitterBridge extends BridgeAbstract { // extract tweet timestamp $item['timestamp'] = $tweet->find('span.js-short-timestamp', 0)->getAttribute('data-time'); // generate the title - $item['title'] = $this->fixAnchorSpacing(strip_tags($tweet->find('p.js-tweet-text', 0), '')); + $item['title'] = strip_tags($this->fixAnchorSpacing($tweet->find('p.js-tweet-text', 0), '')); $this->processContentLinks($tweet); $this->processEmojis($tweet);