]> granicus.if.org Git - php/commitdiff
Fixed bug #45004 (pg_insert() does not accept 4 digit timezone format)
authorIlia Alshanetsky <iliaa@php.net>
Mon, 19 May 2008 15:16:47 +0000 (15:16 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 19 May 2008 15:16:47 +0000 (15:16 +0000)
ext/pgsql/pgsql.c

index f42d9393a9d5d8043c1446255c2b77b312f2ee78..d2794804921ea285ff945f31811440fc553bf4bc 100644 (file)
@@ -5003,7 +5003,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
                                                        ZVAL_STRINGL(new_val, "NOW()", sizeof("NOW()")-1, 1);
                                                } else {
                                                        /* FIXME: better regex must be used */
-                                                       if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\\.[0-9]+){0,1}([ \\t]*([+-][0-9]{1,2}(:[0-9]{1,2}){0,1}|[-a-zA-Z_/+]{1,50})){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) {
+                                                       if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\\.[0-9]+){0,1}([ \\t]*([+-][0-9]{1,4}(:[0-9]{1,2}){0,1}|[-a-zA-Z_/+]{1,50})){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) {
                                                                err = 1;
                                                        } else {
                                                                ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1);