[pmwiki-users] Solved: Commentbox - Preventing posting of directives
Patrick R. Michaud
pmichaud at pobox.com
Mon Oct 2 16:21:09 CDT 2006
On Mon, Oct 02, 2006 at 11:06:09PM +0200, Mike wrote:
> if anybody is interested: I added a line to the commentboxplus recipe
> which introduces a global variable $PreventDirectives.
>
> SDV($PreventDirectives,0);
> if($PreventDirectives == 1){
> $_POST['text'] = ereg_replace(":",":",$_POST['text']);
> }
This actually replaces all colons (including those in "http:" links),
whereas I would only replace colons that follow a parenthesis:
if ($PreventDirectives) {
$_POST['text'] = preg_replace('/\\(:/', '(:', $_POST['text']);
}
Pm
More information about the pmwiki-users
mailing list