diff options
Diffstat (limited to 'pq-upstream.patch')
-rw-r--r-- | pq-upstream.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/pq-upstream.patch b/pq-upstream.patch new file mode 100644 index 0000000..6581539 --- /dev/null +++ b/pq-upstream.patch @@ -0,0 +1,82 @@ +From ef9b34bc5ae76a1a961108085e5d21e8ad679b18 Mon Sep 17 00:00:00 2001 +From: Michael Wallner <mike@php.net> +Date: Tue, 15 Nov 2016 09:53:42 +0100 +Subject: [PATCH] fix issue #23 (PHP-7.1 JSON compat) + +--- + src/php_pq_params.c | 3 +++ + tests/conv001.phpt | 12 ++++++------ + 2 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/src/php_pq_params.c b/src/php_pq_params.c +index 0f7ba50..5a5156f 100644 +--- a/src/php_pq_params.c ++++ b/src/php_pq_params.c +@@ -83,6 +83,9 @@ static zend_string *object_param_to_string(php_pq_params_t *p, zval *zobj, Oid t + case PHP_PQ_OID_JSONB: + # endif + case PHP_PQ_OID_JSON: ++# if PHP_VERSION_ID >= 70100 ++ JSON_G(encode_max_depth) = PHP_JSON_PARSER_DEFAULT_DEPTH; ++# endif + php_json_encode(&str, zobj, PHP_JSON_UNESCAPED_UNICODE); + smart_str_0(&str); + return str.s; +diff --git a/tests/conv001.phpt b/tests/conv001.phpt +index 8533753..b24da0e 100644 +--- a/tests/conv001.phpt ++++ b/tests/conv001.phpt +@@ -328,7 +328,7 @@ array(1) { + ["format"]=> + string(11) "Y-m-d H:i:s" + ["date"]=> +- string(26) "%d-%d-%d %d:%d:%d.000000" ++ string(26) "%d-%d-%d %d:%d:%d.%d" + ["timezone_type"]=> + int(1) + ["timezone"]=> +@@ -339,7 +339,7 @@ array(1) { + ["format"]=> + string(13) "Y-m-d H:i:s.u" + ["date"]=> +- string(26) "%d-%d-%d %d:%d:%d.000000" ++ string(26) "%d-%d-%d %d:%d:%d.%d" + ["timezone_type"]=> + int(3) + ["timezone"]=> +@@ -350,7 +350,7 @@ array(1) { + ["format"]=> + string(14) "Y-m-d H:i:s.uO" + ["date"]=> +- string(26) "%d-%d-%d %d:%d:%d.000000" ++ string(26) "%d-%d-%d %d:%d:%d.%d" + ["timezone_type"]=> + int(1) + ["timezone"]=> +@@ -372,7 +372,7 @@ array(1) { + ["format"]=> + string(11) "Y-m-d H:i:s" + ["date"]=> +- string(26) "%d-%d-%d %d:%d:%d.000000" ++ string(26) "%d-%d-%d %d:%d:%d.%d" + ["timezone_type"]=> + int(1) + ["timezone"]=> +@@ -383,7 +383,7 @@ array(1) { + ["format"]=> + string(13) "Y-m-d H:i:s.u" + ["date"]=> +- string(26) "%d-%d-%d %d:%d:%d.000000" ++ string(26) "%d-%d-%d %d:%d:%d.%d" + ["timezone_type"]=> + int(3) + ["timezone"]=> +@@ -394,7 +394,7 @@ array(1) { + ["format"]=> + string(14) "Y-m-d H:i:s.uO" + ["date"]=> +- string(26) "%d-%d-%d %d:%d:%d.000000" ++ string(26) "%d-%d-%d %d:%d:%d.%d" + ["timezone_type"]=> + int(1) + ["timezone"]=> |