summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2019-11-17 21:28:17 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2019-12-05 13:15:54 +0100
commit633926021bd9657f098b3b0441cf9a4477b8d80f (patch)
tree417f0bda1b7529c965344966d29009991931f45e
parent144b41ce8805e2afcdaa16e3dea350aa136f8849 (diff)
downloadphp-git-633926021bd9657f098b3b0441cf9a4477b8d80f.tar.gz
Remove ezmlm_hash() function
-rw-r--r--Zend/tests/call_to_deprecated_function_args.phpt19
-rwxr-xr-xext/standard/basic_functions.c1
-rwxr-xr-xext/standard/basic_functions.stub.php2
-rwxr-xr-xext/standard/basic_functions_arginfo.h2
-rw-r--r--ext/standard/mail.c23
-rw-r--r--ext/standard/php_mail.h1
-rw-r--r--ext/standard/tests/mail/ezmlm_hash_basic.phpt23
-rw-r--r--ext/zend_test/test.c12
8 files changed, 23 insertions, 60 deletions
diff --git a/Zend/tests/call_to_deprecated_function_args.phpt b/Zend/tests/call_to_deprecated_function_args.phpt
index 5c3eb9ae16..c7781e30e0 100644
--- a/Zend/tests/call_to_deprecated_function_args.phpt
+++ b/Zend/tests/call_to_deprecated_function_args.phpt
@@ -1,5 +1,8 @@
--TEST--
Check that arguments are freed when calling a deprecated function
+--SKIPIF--
+<?php
+if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
--FILE--
<?php
@@ -8,20 +11,20 @@ set_error_handler(function($code, $msg) {
});
try {
- ezmlm_hash(new stdClass);
+ zend_test_deprecated(new stdClass);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
$ret = new stdClass;
try {
- $ret = ezmlm_hash(new stdClass);
+ $ret = zend_test_deprecated(new stdClass());
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
- $fn = 'ezmlm_hash';
+ $fn = 'zend_test_deprecated';
$fn(new stdClass);
} catch (Error $e) {
echo $e->getMessage(), "\n";
@@ -29,7 +32,7 @@ try {
$ret = new stdClass;
try {
- $fn = 'ezmlm_hash';
+ $fn = 'zend_test_deprecated';
$ret = $fn(new stdClass);
} catch (Error $e) {
echo $e->getMessage(), "\n";
@@ -37,7 +40,7 @@ try {
?>
--EXPECT--
-Function ezmlm_hash() is deprecated
-Function ezmlm_hash() is deprecated
-Function ezmlm_hash() is deprecated
-Function ezmlm_hash() is deprecated
+Function zend_test_deprecated() is deprecated
+Function zend_test_deprecated() is deprecated
+Function zend_test_deprecated() is deprecated
+Function zend_test_deprecated() is deprecated
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 23bf7daaf6..1f246a6ba8 100755
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -1415,7 +1415,6 @@ static const zend_function_entry basic_functions[] = { /* {{{ */
/* functions from mail.c */
PHP_FE(mail, arginfo_mail)
- PHP_DEP_FE(ezmlm_hash, arginfo_ezmlm_hash)
/* functions from syslog.c */
#ifdef HAVE_SYSLOG_H
diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php
index 98771c62f7..60a26d02ad 100755
--- a/ext/standard/basic_functions.stub.php
+++ b/ext/standard/basic_functions.stub.php
@@ -840,8 +840,6 @@ function link(string $target, string $link): bool {}
/* mail.c */
-function ezmlm_hash(string $str): int {}
-
/** @param string|array $additional_headers */
function mail(string $to, string $subject, string $message, $additional_headers = UNKNOWN, string $additional_parameters = ""): bool {}
diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h
index 3bc370734b..51d0ff7f13 100755
--- a/ext/standard/basic_functions_arginfo.h
+++ b/ext/standard/basic_functions_arginfo.h
@@ -1290,8 +1290,6 @@ ZEND_END_ARG_INFO()
#define arginfo_link arginfo_symlink
#endif
-#define arginfo_ezmlm_hash arginfo_crc32
-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mail, 0, 3, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0)
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index 775cd0da54..b6f987d80f 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -64,29 +64,6 @@
extern zend_long php_getuid(void);
-/* {{{ proto int ezmlm_hash(string addr)
- Calculate EZMLM list hash value. */
-PHP_FUNCTION(ezmlm_hash)
-{
- char *str = NULL;
- unsigned int h = 5381;
- size_t j, str_len;
-
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STRING(str, str_len)
- ZEND_PARSE_PARAMETERS_END();
-
- for (j = 0; j < str_len; j++) {
- h = (h + (h << 5)) ^ (zend_ulong) (unsigned char) tolower(str[j]);
- }
-
- h = (h % 53);
-
- RETURN_LONG((zend_long) h);
-}
-/* }}} */
-
-
static zend_bool php_mail_build_headers_check_field_value(zval *val)
{
size_t len = 0;
diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h
index 12203830c6..0e226ba6a1 100644
--- a/ext/standard/php_mail.h
+++ b/ext/standard/php_mail.h
@@ -18,7 +18,6 @@
#define PHP_MAIL_H
PHP_FUNCTION(mail);
-PHP_FUNCTION(ezmlm_hash);
PHP_MINFO_FUNCTION(mail);
diff --git a/ext/standard/tests/mail/ezmlm_hash_basic.phpt b/ext/standard/tests/mail/ezmlm_hash_basic.phpt
deleted file mode 100644
index 31c1019c7a..0000000000
--- a/ext/standard/tests/mail/ezmlm_hash_basic.phpt
+++ /dev/null
@@ -1,23 +0,0 @@
---TEST--
-Test ezmlm_hash() function : basic functionality
---FILE--
-<?php
-/* Prototype : int ezmlm_hash ( string $addr )
- * Description: Calculate the hash value needed by EZMLM.
- * Source code: ext/standard/mail.c
- */
-
-echo "*** Testing ezmlm_hash() : basic functionality ***\n";
-
-var_dump(ezmlm_hash("webmaster@somewhere.com"));
-var_dump(ezmlm_hash("foo@somewhere.com"));
-
-?>
---EXPECTF--
-*** Testing ezmlm_hash() : basic functionality ***
-
-Deprecated: Function ezmlm_hash() is deprecated in %s on line %d
-int(1)
-
-Deprecated: Function ezmlm_hash() is deprecated in %s on line %d
-int(7)
diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c
index 318419ba3e..b4a5ad927a 100644
--- a/ext/zend_test/test.c
+++ b/ext/zend_test/test.c
@@ -38,6 +38,10 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_zend_test_void_return, IS_VOID, 0)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_zend_test_deprecated, IS_VOID, 0)
+ ZEND_ARG_INFO(0, arg1)
+ZEND_END_ARG_INFO()
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_terminate_string, 0, 0, 1)
ZEND_ARG_INFO(1, str)
ZEND_END_ARG_INFO()
@@ -76,6 +80,13 @@ ZEND_FUNCTION(zend_test_void_return)
/* dummy */
}
+ZEND_FUNCTION(zend_test_deprecated)
+{
+ zval *arg1;
+
+ zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &arg1);
+}
+
/* Create a string without terminating null byte. Must be termined with
* zend_terminate_string() before destruction, otherwise a warning is issued
* in debug builds. */
@@ -322,6 +333,7 @@ static const zend_function_entry zend_test_functions[] = {
ZEND_FE(zend_test_array_return, arginfo_zend_test_array_return)
ZEND_FE(zend_test_nullable_array_return, arginfo_zend_test_nullable_array_return)
ZEND_FE(zend_test_void_return, arginfo_zend_test_void_return)
+ ZEND_DEP_FE(zend_test_deprecated, arginfo_zend_test_deprecated)
ZEND_FE(zend_create_unterminated_string, NULL)
ZEND_FE(zend_terminate_string, arginfo_zend_terminate_string)
ZEND_FE(zend_leak_bytes, NULL)