Needs review
Project:
Validation API
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 Apr 2009 at 18:43 UTC
Updated:
14 Apr 2009 at 08:22 UTC
Jump to comment: Most recent file
I have Drupal 6.10 with CCK 6.x-2.2 and Validation_API 6.x-1.0.
I want to check two CCK text fields f1 and f2 with the regexp rule /^[0-9]{1,%arguments[0]}$/. They are on the same form. f1 must be 10 or less characters long and f2 – 20 characters or less. So I added validator to this two fields with different arguments.
I get validation for both fields 10 or less characters long.
After some research I found a bug (I think) in the code string
$validator->rule = str_replace('%arguments['. $delta .']', $argument, $validator->rule);.
All works fine after fix, but still, please review it. All the changes in the patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | validation_api_mixed_regexp_arguments[1].patch | 970 bytes | cardina1 |
| validation_api_mixed_regexp_arguments.patch | 1.06 KB | cardina1 |
Comments
Comment #1
cardina1 commentedSorry, first patch don't allow several argiments in a regexp. Here is a new revision.