Reversing Regex output

Home Forums Quform PHP Reversing Regex output

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33772
    Poller54
    Participant

    Hello,
    I use Codecanyon-ploNMuQ4-quform. I try to block bad words in my message form element using the Regex-Validator (preg_match).
    So far it works at the page, except I don’t know how making the function to reverse the output. I read something about an “invert option”. But I think that’s for WordPress.
    Another question would be, if it is possible or advisable to make further processing to die, after the validation?

    “$message = new Quform_Element(‘message’, ‘Message’);
    $message->addFilter(‘trim’);
    $message->addValidator(‘required’);
    $message->addValidator(‘regex’, array(
    ‘pattern’ => ‘/viagra|cialis/’,
    ‘messages’ => array(
    ‘preg_match’ => ‘The given value “%s” is not a valid number’
    )
    ));
    $form->addElement($message);

    #33775
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #33780
    Poller54
    Participant

    Hello Ally,

    thank you so much. It works.
    I wouldn’t have been able to solve this by myself
    I appreciate very much.

    Regards
    Harald

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2020 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy