Buy Now
Sign in

CF 6.0.13 - Regular expression for field validation doesn't work

bdernier , October 25 2017

I would like to use regular expression to validate a field, so I put my regex string into "regular expression" field. Problem is the validation doesn't work and this is the result of my investigation.

In the file /cegcore2/admin/extensions/chronofc/functions/validate_fields_output.php the parameter from the "regular expression" is empty. Starting line 69 this is the code that extracts the regexp parameter to fill $vfnParam. But for that the rule should contain a bracket (this is tested line76) but in my case the rule = "regExp" without any brackets.
          $fview['validation'] = array_filter($fview['validation']);
            foreach($fview['validation'] as $rule => $ruledata){
              $vfn = $rule;
              $vfnParam = null;
              if(strpos($vfn, '[') !== false){
                $vfnps = explode('[', $vfn, 2);
                $vfn = $vfnps[0];
                $vfnParam = rtrim($vfnps[1], ']');

So on the following lines (starting line 89) we call the validate.php file with "regex" but without the string to be compared with since we don't pass $vfnParam

Regular expression validation is always wrong so.
                if(in_array($vfn, ['match', 'different'])){
                  $vfnParam = \G2\L\Arr::getVal($data, $vfnParam);
                $condition = (bool)$validator::$vfn(\G2\L\Arr::getVal($data, $fname), $vfnParam);
                $condition = (bool)$validator::$vfn(\G2\L\Arr::getVal($data, $fname));

Do you confirm such bug or can you explain me where I am wrong ?

Best Regards,
Validation error after update from v6.0.9 to v6.0.13

I used regular expressions to validate some fields. In version 6.0.9 everything worked fine. Since the update to version 6.0.13 this fields don't pass the validation and i can't submit the form.

This is my regular expression in the regexp field in the designer section:

/^[a-zA-ZäöüÄÖÜ ._,-]+$/i

Best Regards,


This issue should be fixed with the new update!

Best regards
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!