[pmwiki-users] pmform input filtering

Patrick R. Michaud pmichaud at pobox.com
Thu Sep 13 08:02:50 CDT 2007


On Thu, Sep 13, 2007 at 01:04:40PM +0300, blues wrote:
> 
> is there a way to filter input from a pmform form?
> what i want to do is avoid users to input some markup
> and especially directives from inside a comment box.

PmForm already blocks directives from data being saved to
pages by converting markups: thus "(:" becomes "( :"
and ":)" becomes ": )".  These are managed by the 
$PmFormPostPatterns array.

The (:template require:) directive can be used to
prevent certain string combinations from appearing in
posted fields.  For example, to prevent someone from
entering link markups, use:

    (:template require text match=-[[ errmsg="links not allowed":)

which says that the 'text' field must not contain "[[".

Pm



More information about the pmwiki-users mailing list