Fixing the Regex validator

This documentation page is for Quform version 1 and may not be applicable for Quform 2 click here to visit the documentation for Quform 2.

This guide applies to Quform version 1.3.6 or earlier

The Regex validator is broken in version 1.3.6 and earlier, and fixed in 1.4 or later. To fix it edit the file iphorm-form-builder/includes/iPhorm/Validator/Regex.php, find these lines:

1
2
3
4
$regexFilter = new iPhorm_Filter_Regex();
$regexFilter->setPattern($this->getPattern());
 
if ($value !== $regexFilter->filter($value)) {
$regexFilter = new iPhorm_Filter_Regex();
$regexFilter->setPattern($this->getPattern());

if ($value !== $regexFilter->filter($value)) {

Replace them with this line:

1
if (!preg_match($this->getPattern(), $value)) {
if (!preg_match($this->getPattern(), $value)) {

Save the file and upload it via FTP to overwrite the original file.

Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy