]> granicus.if.org Git - php/commitdiff
Remove ezmlm_hash() function
authorMáté Kocsis <kocsismate@woohoolabs.com>
Sun, 17 Nov 2019 20:28:17 +0000 (21:28 +0100)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Thu, 5 Dec 2019 12:15:54 +0000 (13:15 +0100)
Zend/tests/call_to_deprecated_function_args.phpt
ext/standard/basic_functions.c
ext/standard/basic_functions.stub.php
ext/standard/basic_functions_arginfo.h
ext/standard/mail.c
ext/standard/php_mail.h
ext/standard/tests/mail/ezmlm_hash_basic.phpt [deleted file]
ext/zend_test/test.c

index 5c3eb9ae1610398526ce68f0c4b604af726df81e..c7781e30e0acb9d94ffa24f27118e463c820c3bb 100644 (file)
@@ -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
index 23bf7daaf6c029b75012a39bc6561d22c75e97dc..1f246a6ba89ac3928ae3bf5e4ab2be00a0886c52 100755 (executable)
@@ -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
index 98771c62f7bba0feee341e0bc3047ee740ef1e56..60a26d02ad067c4b4532b5f5b1693c1e7146f7d2 100755 (executable)
@@ -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 {}
 
index 3bc370734bbc6225c6339bca58c9b63a2463669d..51d0ff7f139b6c3280c6c9568eae6d1e07cc93f3 100755 (executable)
@@ -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)
index 775cd0da54e2321c201b3876b836e76b3a8490a9..b6f987d80f8aefae9681be820ea463c4db1947c1 100644 (file)
 
 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;
index 12203830c6edb75f2957f3a280dcb72f4c6b30b8..0e226ba6a1a2efba19e9510e921cfba66e728fb3 100644 (file)
@@ -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 (file)
index 31c1019..0000000
+++ /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)
index 318419ba3e37b90ebaeed29eafd253a202f0501e..b4a5ad927a99bfd2c11b3885ce2830db63b131a9 100644 (file)
@@ -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)