Twitter timeline produces invalid XHTML
Posted: Thu May 19, 2011 12:30 am
I just noticed that the latest version (1.34) of the Twitter timeline plugin in PHP output mode produces invalid XHTML for @replies, on Serendipity 1.5.5 and PHP 5.3.5; for example:
There’s a blank missing between the href and class attributes. The following change to serendipity_plugin_twitter/classes/Twitter.php appears to fix it:
Line 420:
Replace with:
(Just a forced blank preceding $class.)
Code: Select all
<span> @<a href="http://twitter.com/username"class="twitter_user">username</a> This is a reply.</span>Line 420:
Code: Select all
$status = preg_replace('{@([\w_]*)}','@<a href="' . $this->get_base_url() . '$1"' . $class . '>$1</a>', $status);Code: Select all
$status = preg_replace('{@([\w_]*)}','@<a href="' . $this->get_base_url() . '$1" ' . $class . '>$1</a>', $status);