checkProfileOptions: skip regex check for empty fields

This commit is contained in:
Roland Gruber 2004-07-03 16:11:13 +00:00
parent 4c8aefea8c
commit 6b73cc11c6
1 changed files with 2 additions and 0 deletions

View File

@ -152,6 +152,8 @@ class baseModule {
if ($this->meta['profile_checks'][$identifiers[$i]]['required'] && ($options[$identifiers[$i]][0] == '')) {
$messages[] = $this->meta['profile_checks'][$identifiers[$i]]['required_message'];
}
// ignore empty fileds
if ($options[$identifiers[$i]][0] == '') continue;
// check by regular expression (case insensitive)
if ($this->meta['profile_checks'][$identifiers[$i]]['type'] == 'regex_i') {
if (! eregi($this->meta['profile_checks'][$identifiers[$i]]['regex'], $options[$identifiers[$i]][0])) {