[pmwiki-users] How to protect PMForm against spam?

Patrick R. Michaud pmichaud at pobox.com
Mon Mar 3 11:12:04 CST 2008


On Mon, Mar 03, 2008 at 04:01:47PM +0100, Roman wrote:
> 
>      Try
> 
>         (:template require <field> match=-"[url=" :)
> 
>      where <field> is the input form field you want to check for "[url=".
> 
>    -"[url=" as a value of match parameter produces warning: "preg_match():
>    Compilation failed: missing terminating ] for character class at offset 10
>    in pmform.php on line 98"

Interesting -- that's undoubtedly a bug (perhaps even in
PmWiki!).  I'll have to look into that.

>    After several attempts I found this:
>    1. It looks that match parameter does not match substring but entire
>    content of input field. The following works but only if href is the only
>    text in <field>.
> 
>     (:template require <field> match=-href :)

Try

    (:template require <field> match="-*href*" :)

>    2. Match does not accept quotes.
> 
>     (:template require <field> match=-"href" :) does not work even if href is
>    the only text of <field>.

Ah, I think that match accepts quotes but only if they
immediately follow the '=' sign.  Thus the version I gave above.

Pm



More information about the pmwiki-users mailing list