Fix preg_match in guess_type function (#6123)

pull/6465/head
Richard Hillmann 7 years ago committed by Aleksander Machniak
parent 55ba350102
commit b9c038ca63

@ -109,13 +109,13 @@ class rcube_config
// array requires hint to be passed. // array requires hint to be passed.
if (preg_match('/^[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?$/', $value) !== false) { if (preg_match('/^[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?$/', $value)) {
$type = 'double'; $type = 'double';
} }
else if (preg_match('/^\d+$/', $value) !== false) { else if (preg_match('/^\d+$/', $value)) {
$type = 'integer'; $type = 'integer';
} }
else if (preg_match('/(t(rue)?)|(f(alse)?)/i', $value) !== false) { else if (preg_match('/^(t(rue)?)|(f(alse)?)$/i', $value)) {
$type = 'boolean'; $type = 'boolean';
} }

Loading…
Cancel
Save