checkProfileOptions: skip regex check for empty fields
This commit is contained in:
parent
4c8aefea8c
commit
6b73cc11c6
|
@ -152,6 +152,8 @@ class baseModule {
|
||||||
if ($this->meta['profile_checks'][$identifiers[$i]]['required'] && ($options[$identifiers[$i]][0] == '')) {
|
if ($this->meta['profile_checks'][$identifiers[$i]]['required'] && ($options[$identifiers[$i]][0] == '')) {
|
||||||
$messages[] = $this->meta['profile_checks'][$identifiers[$i]]['required_message'];
|
$messages[] = $this->meta['profile_checks'][$identifiers[$i]]['required_message'];
|
||||||
}
|
}
|
||||||
|
// ignore empty fileds
|
||||||
|
if ($options[$identifiers[$i]][0] == '') continue;
|
||||||
// check by regular expression (case insensitive)
|
// check by regular expression (case insensitive)
|
||||||
if ($this->meta['profile_checks'][$identifiers[$i]]['type'] == 'regex_i') {
|
if ($this->meta['profile_checks'][$identifiers[$i]]['type'] == 'regex_i') {
|
||||||
if (! eregi($this->meta['profile_checks'][$identifiers[$i]]['regex'], $options[$identifiers[$i]][0])) {
|
if (! eregi($this->meta['profile_checks'][$identifiers[$i]]['regex'], $options[$identifiers[$i]][0])) {
|
||||||
|
|
Loading…
Reference in New Issue