Browse Source

[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
logmanoriginal 7 years ago
parent
commit
d7ff8b9ac7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      bridges/TwitterBridge.php

+ 1 - 1
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), '<a>'));
+			$item['title'] = strip_tags($this->fixAnchorSpacing($tweet->find('p.js-tweet-text', 0), '<a>'));
 
 			$this->processContentLinks($tweet);
 			$this->processEmojis($tweet);