Fixing the Regex validator

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.

Still having trouble? Head over to the forums.

Forums