[Assorted-commits] SF.net SVN: assorted:[1027] wp-easy-filter/trunk/src/easyfilt.php
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-10-22 22:49:54
|
Revision: 1027 http://assorted.svn.sourceforge.net/assorted/?rev=1027&view=rev Author: yangzhang Date: 2008-10-22 22:49:51 +0000 (Wed, 22 Oct 2008) Log Message: ----------- fixed bug coexisting with existing filters Modified Paths: -------------- wp-easy-filter/trunk/src/easyfilt.php Modified: wp-easy-filter/trunk/src/easyfilt.php =================================================================== --- wp-easy-filter/trunk/src/easyfilt.php 2008-10-22 22:40:35 UTC (rev 1026) +++ wp-easy-filter/trunk/src/easyfilt.php 2008-10-22 22:49:51 UTC (rev 1027) @@ -41,7 +41,6 @@ $debug = false; $debugfile = '/mit/y_z/web_scripts/wp/wp-content/plugins/easyfilt/log.txt'; add_filter('the_content', 'filter_custom', 1); -remove_filter('the_content', 'wpautop'); # # Constants. @@ -62,6 +61,7 @@ $lines = explode("\n", $content); $tag = trim(substr($lines[0], 2)); if (substr($lines[0], 0, 2) === '#!' && $tag2cmd[$tag]) { + remove_filter('the_content', 'wpautop'); $cmd = $tag2cmd[$tag]; $process = proc_open($cmd, $descriptorspec, $pipes); $body = implode("\n", array_slice($lines, 1)); @@ -75,6 +75,7 @@ $retval = proc_close($process); } } else { + add_filter('the_content', 'wpautop'); $filtered = $content; } if ($debug) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |