From: inem0o Date: Sat, 10 Aug 2019 13:54:43 +0000 (+0200) Subject: Add base64_encode / base64_decode stubs X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b98bc5bd9216be9d2ee47d251630d069d30e129d;p=php Add base64_encode / base64_decode stubs Closes GH-4504. --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index f7490211b3..d1ac708795 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -760,17 +760,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_assert_options, 0, 0, 1) ZEND_ARG_INFO(0, what) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -/* }}} */ -/* {{{ base64.c */ -ZEND_BEGIN_ARG_INFO(arginfo_base64_encode, 0) - ZEND_ARG_INFO(0, str) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_base64_decode, 0, 0, 1) - ZEND_ARG_INFO(0, str) - ZEND_ARG_INFO(0, strict) -ZEND_END_ARG_INFO() - /* }}} */ /* {{{ browscap.c */ ZEND_BEGIN_ARG_INFO_EX(arginfo_get_browser, 0, 0, 0) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index d071126922..ba7300e198 100644 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -59,3 +59,10 @@ function stream_wrapper_restore(string $protocol): bool {} /** @return int|false */ function array_push(array &$stack, ...$args) {} + +/* base64.c */ + +function base64_encode(string $str): string {} + +/** @return string|false */ +function base64_decode(string $str, bool $strict = false) {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index bc43829120..23b2dce733 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -69,3 +69,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_push, 0, 0, 1) ZEND_ARG_TYPE_INFO(1, stack, IS_ARRAY, 0) ZEND_ARG_VARIADIC_INFO(0, args) ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_base64_encode, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_base64_decode, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, strict, _IS_BOOL, 0) +ZEND_END_ARG_INFO()