From 1c902e2e630a6ed61983804994a4e312853008b4 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 7 Sep 2015 23:46:12 +0200 Subject: [PATCH] Fix #70454: IntlChar::forDigit second parameter should be optional ZPP expects "ll" instead of "l|l" what would match the "proto" and the ARG_INFO. --- ext/intl/uchar/tests/bug70454.phpt | 18 ++++++++++++++++++ ext/intl/uchar/uchar.c | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 ext/intl/uchar/tests/bug70454.phpt diff --git a/ext/intl/uchar/tests/bug70454.phpt b/ext/intl/uchar/tests/bug70454.phpt new file mode 100644 index 0000000000..351bb65243 --- /dev/null +++ b/ext/intl/uchar/tests/bug70454.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #70454 (IntlChar::forDigit second parameter should be optional) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +int(48) +int(51) +int(51) +int(0) +int(97) diff --git a/ext/intl/uchar/uchar.c b/ext/intl/uchar/uchar.c index 79eb8fda01..243da122a2 100644 --- a/ext/intl/uchar/uchar.c +++ b/ext/intl/uchar/uchar.c @@ -479,7 +479,7 @@ ZEND_END_ARG_INFO(); IC_METHOD(forDigit) { zend_long digit, radix = 10; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &digit, &radix) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &digit, &radix) == FAILURE) { return; } -- 2.40.0