Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion inc/field/emailfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function lessThan($value): bool {
}

public function regex($value): bool {
return (preg_grep($value, $this->value)) ? true : false;
return (preg_match($value, $this->value) === 1) ? true : false;
}

public function isPublicFormCompatible(): bool {
Expand Down
2 changes: 1 addition & 1 deletion inc/field/floatfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public function lessThan($value): bool {
}

public function regex($value): bool {
return (preg_grep($value, $this->value)) ? true : false;
return (preg_match($value, $this->value) === 1) ? true : false;
}

public function isPublicFormCompatible(): bool {
Expand Down
2 changes: 1 addition & 1 deletion inc/field/hiddenfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function lessThan($value): bool {
}

public function regex($value): bool {
return (preg_grep($value, $this->value)) ? true : false;
return (preg_match($value, $this->value) === 1) ? true : false;
}

public function isPublicFormCompatible(): bool {
Expand Down
2 changes: 1 addition & 1 deletion inc/field/hostnamefield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function lessThan($value): bool {
}

public function regex($value): bool {
return (preg_grep($value, $this->value)) ? true : false;
return (preg_match($value, $this->value) === 1) ? true : false;
}

public function isPublicFormCompatible(): bool {
Expand Down
4 changes: 0 additions & 4 deletions inc/field/integerfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,6 @@ public function greaterThan($value): bool {
return ((int) $this->value) > ((int) $value);
}

public function regex($value): bool {
return (preg_grep($value, (int) $this->value)) ? true : false;
}

public function getHtmlIcon() {
return '<i class="fas fa-square-root-alt" aria-hidden="true"></i>';
}
Expand Down
2 changes: 1 addition & 1 deletion inc/field/ipfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function lessThan($value): bool {
}

public function regex($value): bool {
return (preg_grep($value, $this->value)) ? true : false;
return (preg_match($value, $this->value) === 1) ? true : false;
}

public function isPublicFormCompatible(): bool {
Expand Down
2 changes: 1 addition & 1 deletion inc/field/textareafield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public function lessThan($value): bool {
}

public function regex($value): bool {
return (preg_grep($value, $this->value)) ? true : false;
return (preg_match(Sanitizer::unsanitize($value), $this->value) === 1) ? true : false;
}

public function isPublicFormCompatible(): bool {
Expand Down