Skip to content

Commit 987bb86

Browse files
committed
Remove ezmlm_hash() function
1 parent 70dc5d3 commit 987bb86

File tree

9 files changed

+23
-61
lines changed

9 files changed

+23
-61
lines changed
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
--TEST--
22
Check that arguments are freed when calling a deprecated function
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
36
--FILE--
47
<?php
58

@@ -8,36 +11,36 @@ set_error_handler(function($code, $msg) {
811
});
912

1013
try {
11-
ezmlm_hash(new stdClass);
14+
zend_test_deprecated(new stdClass);
1215
} catch (Error $e) {
1316
echo $e->getMessage(), "\n";
1417
}
1518

1619
$ret = new stdClass;
1720
try {
18-
$ret = ezmlm_hash(new stdClass);
21+
$ret = zend_test_deprecated(new stdClass());
1922
} catch (Error $e) {
2023
echo $e->getMessage(), "\n";
2124
}
2225

2326
try {
24-
$fn = 'ezmlm_hash';
27+
$fn = 'zend_test_deprecated';
2528
$fn(new stdClass);
2629
} catch (Error $e) {
2730
echo $e->getMessage(), "\n";
2831
}
2932

3033
$ret = new stdClass;
3134
try {
32-
$fn = 'ezmlm_hash';
35+
$fn = 'zend_test_deprecated';
3336
$ret = $fn(new stdClass);
3437
} catch (Error $e) {
3538
echo $e->getMessage(), "\n";
3639
}
3740

3841
?>
3942
--EXPECT--
40-
Function ezmlm_hash() is deprecated
41-
Function ezmlm_hash() is deprecated
42-
Function ezmlm_hash() is deprecated
43-
Function ezmlm_hash() is deprecated
43+
Function zend_test_deprecated() is deprecated
44+
Function zend_test_deprecated() is deprecated
45+
Function zend_test_deprecated() is deprecated
46+
Function zend_test_deprecated() is deprecated

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,6 @@ static const func_info_t func_infos[] = {
532532
F0("realpath_cache_size", MAY_BE_LONG),
533533
F1("realpath_cache_get", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
534534
F0("mail", MAY_BE_FALSE | MAY_BE_TRUE),
535-
F0("ezmlm_hash", MAY_BE_LONG),
536535
#ifdef HAVE_SYSLOG_H
537536
F0("closelog", MAY_BE_TRUE),
538537
#endif

ext/standard/basic_functions.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,6 @@ static const zend_function_entry basic_functions[] = { /* {{{ */
14151415

14161416
/* functions from mail.c */
14171417
PHP_FE(mail, arginfo_mail)
1418-
PHP_DEP_FE(ezmlm_hash, arginfo_ezmlm_hash)
14191418

14201419
/* functions from syslog.c */
14211420
#ifdef HAVE_SYSLOG_H

ext/standard/basic_functions.stub.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,6 @@ function link(string $target, string $link): bool {}
845845

846846
/* mail.c */
847847

848-
function ezmlm_hash(string $str): int {}
849-
850848
/** @param string|array $additional_headers */
851849
function mail(string $to, string $subject, string $message, $additional_headers = UNKNOWN, string $additional_parameters = ""): bool {}
852850

ext/standard/basic_functions_arginfo.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,8 +1287,6 @@ ZEND_END_ARG_INFO()
12871287
#define arginfo_link arginfo_symlink
12881288
#endif
12891289

1290-
#define arginfo_ezmlm_hash arginfo_crc32
1291-
12921290
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mail, 0, 3, _IS_BOOL, 0)
12931291
ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0)
12941292
ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0)

ext/standard/mail.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,29 +64,6 @@
6464

6565
extern zend_long php_getuid(void);
6666

67-
/* {{{ proto int ezmlm_hash(string addr)
68-
Calculate EZMLM list hash value. */
69-
PHP_FUNCTION(ezmlm_hash)
70-
{
71-
char *str = NULL;
72-
unsigned int h = 5381;
73-
size_t j, str_len;
74-
75-
ZEND_PARSE_PARAMETERS_START(1, 1)
76-
Z_PARAM_STRING(str, str_len)
77-
ZEND_PARSE_PARAMETERS_END();
78-
79-
for (j = 0; j < str_len; j++) {
80-
h = (h + (h << 5)) ^ (zend_ulong) (unsigned char) tolower(str[j]);
81-
}
82-
83-
h = (h % 53);
84-
85-
RETURN_LONG((zend_long) h);
86-
}
87-
/* }}} */
88-
89-
9067
static zend_bool php_mail_build_headers_check_field_value(zval *val)
9168
{
9269
size_t len = 0;

ext/standard/php_mail.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#define PHP_MAIL_H
1919

2020
PHP_FUNCTION(mail);
21-
PHP_FUNCTION(ezmlm_hash);
2221

2322
PHP_MINFO_FUNCTION(mail);
2423

ext/standard/tests/mail/ezmlm_hash_basic.phpt

Lines changed: 0 additions & 23 deletions
This file was deleted.

ext/zend_test/test.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ ZEND_END_ARG_INFO()
3838
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_zend_test_void_return, IS_VOID, 0)
3939
ZEND_END_ARG_INFO()
4040

41+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_zend_test_deprecated, IS_VOID, 0)
42+
ZEND_ARG_INFO(0, arg1)
43+
ZEND_END_ARG_INFO()
44+
4145
ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_terminate_string, 0, 0, 1)
4246
ZEND_ARG_INFO(1, str)
4347
ZEND_END_ARG_INFO()
@@ -76,6 +80,13 @@ ZEND_FUNCTION(zend_test_void_return)
7680
/* dummy */
7781
}
7882

83+
ZEND_FUNCTION(zend_test_deprecated)
84+
{
85+
zval *arg1;
86+
87+
zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &arg1);
88+
}
89+
7990
/* Create a string without terminating null byte. Must be termined with
8091
* zend_terminate_string() before destruction, otherwise a warning is issued
8192
* in debug builds. */
@@ -322,6 +333,7 @@ static const zend_function_entry zend_test_functions[] = {
322333
ZEND_FE(zend_test_array_return, arginfo_zend_test_array_return)
323334
ZEND_FE(zend_test_nullable_array_return, arginfo_zend_test_nullable_array_return)
324335
ZEND_FE(zend_test_void_return, arginfo_zend_test_void_return)
336+
ZEND_DEP_FE(zend_test_deprecated, arginfo_zend_test_deprecated)
325337
ZEND_FE(zend_create_unterminated_string, NULL)
326338
ZEND_FE(zend_terminate_string, arginfo_zend_terminate_string)
327339
ZEND_FE(zend_leak_bytes, NULL)

0 commit comments

Comments
 (0)