Fixed bug #77047 pg_convert has a broken regex for the 'TIME WITHOUT TIMEZONE' data type

Backport 369c991d and 282a63da to 7.1, closes #3634
This commit is contained in:
Anatol Belski 2018-11-18 12:29:34 +01:00
parent a56cdd0a82
commit 0434141ce9
2 changed files with 41 additions and 1 deletions

View file

@ -6267,7 +6267,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* FIXME: better regex must be used */
if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1})){0,1}$", 1) == FAILURE) {
if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}){0,1}$", 1) == FAILURE) {
err = 1;
}
else {