Democracy Needs an Update for WordPress 2.5
Posted April 7th, 2008 @ 09:01am by Erik J. Barzeski
The Democracy (voting) plugin needs an update from 2.0.1 for WordPress 2.5. The un-edited 2.0.1 leaves a lot of "n" characters (presumably from the "\n" characters in the source files) in posts. Per the later comments on the page, removal of all "\n" from the two files class.php and democracy.php is a temporary work-around.
Here's to hoping the authors of such plugins aren't abandoning them. My plugins still work and I still use both on several sites.
Posted 13 Apr 2008 at 9:08pm #
My fix for the problem was to open democracy.php, find the line
return preg_replace('/{democracy[\w\W\s^}]*?}/', '\n\', $content);
and replace it with
return preg_replace('/{democracy[\w\W\s^}]*?}/', '\', $content);
The comment says the divs are added to maintain valid HTML, but I passed (http://the.jhu.edu/ccs/?page_id=27) through http://validator.w3.org/ and it still validates so I suppose my fix doesn't break anything.
Posted 13 Apr 2008 at 9:09pm #
Hmm, it looks like part of the code was snipped away. Well, if you look for this line in democracy.php
function jal_add_dem_div($content)
you will see the offending \n. Just remove it. There's only one \n in that function.
Posted 18 Apr 2008 at 3:21pm #
Awesome. Thanks for the fix.
Posted 24 Sep 2008 at 5:14pm #
the fix in function jal_add_dem_div($content) worked a treat ! Cheers.