New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecations for PHP 7.3 #3366

Merged
merged 6 commits into from Jul 21, 2018
Next

Deprecate undocumented mbereg_* aliases

  • Loading branch information...
nikic committed Jul 4, 2018
commit e6016ab20d6699cac9441686903051b3a815cbba
Copy path View file
@@ -44,20 +44,20 @@
PHP_FE(mb_ereg_search_getregs, arginfo_mb_ereg_search_getregs) \
PHP_FE(mb_ereg_search_getpos, arginfo_mb_ereg_search_getpos) \
PHP_FE(mb_ereg_search_setpos, arginfo_mb_ereg_search_setpos) \
PHP_FALIAS(mbregex_encoding, mb_regex_encoding, arginfo_mb_regex_encoding) \
PHP_FALIAS(mbereg, mb_ereg, arginfo_mb_ereg) \
PHP_FALIAS(mberegi, mb_eregi, arginfo_mb_eregi) \
PHP_FALIAS(mbereg_replace, mb_ereg_replace, arginfo_mb_ereg_replace) \
PHP_FALIAS(mberegi_replace, mb_eregi_replace, arginfo_mb_eregi_replace) \
PHP_FALIAS(mbsplit, mb_split, arginfo_mb_split) \
PHP_FALIAS(mbereg_match, mb_ereg_match, arginfo_mb_ereg_match) \
PHP_FALIAS(mbereg_search, mb_ereg_search, arginfo_mb_ereg_search) \
PHP_FALIAS(mbereg_search_pos, mb_ereg_search_pos, arginfo_mb_ereg_search_pos) \
PHP_FALIAS(mbereg_search_regs, mb_ereg_search_regs, arginfo_mb_ereg_search_regs) \
PHP_FALIAS(mbereg_search_init, mb_ereg_search_init, arginfo_mb_ereg_search_init) \
PHP_FALIAS(mbereg_search_getregs, mb_ereg_search_getregs, arginfo_mb_ereg_search_getregs) \
PHP_FALIAS(mbereg_search_getpos, mb_ereg_search_getpos, arginfo_mb_ereg_search_getpos) \
PHP_FALIAS(mbereg_search_setpos, mb_ereg_search_setpos, arginfo_mb_ereg_search_setpos)
PHP_DEP_FALIAS(mbregex_encoding, mb_regex_encoding, arginfo_mb_regex_encoding) \
PHP_DEP_FALIAS(mbereg, mb_ereg, arginfo_mb_ereg) \
PHP_DEP_FALIAS(mberegi, mb_eregi, arginfo_mb_eregi) \
PHP_DEP_FALIAS(mbereg_replace, mb_ereg_replace, arginfo_mb_ereg_replace) \
PHP_DEP_FALIAS(mberegi_replace, mb_eregi_replace, arginfo_mb_eregi_replace) \
PHP_DEP_FALIAS(mbsplit, mb_split, arginfo_mb_split) \
PHP_DEP_FALIAS(mbereg_match, mb_ereg_match, arginfo_mb_ereg_match) \
PHP_DEP_FALIAS(mbereg_search, mb_ereg_search, arginfo_mb_ereg_search) \
PHP_DEP_FALIAS(mbereg_search_pos, mb_ereg_search_pos, arginfo_mb_ereg_search_pos) \
PHP_DEP_FALIAS(mbereg_search_regs, mb_ereg_search_regs, arginfo_mb_ereg_search_regs) \
PHP_DEP_FALIAS(mbereg_search_init, mb_ereg_search_init, arginfo_mb_ereg_search_init) \
PHP_DEP_FALIAS(mbereg_search_getregs, mb_ereg_search_getregs, arginfo_mb_ereg_search_getregs) \
PHP_DEP_FALIAS(mbereg_search_getpos, mb_ereg_search_getpos, arginfo_mb_ereg_search_getpos) \
PHP_DEP_FALIAS(mbereg_search_setpos, mb_ereg_search_setpos, arginfo_mb_ereg_search_setpos)
/* }}} */
#define PHP_MBREGEX_MAXCACHE 50
@@ -7,9 +7,9 @@ Bug #72164 (Null Pointer Dereference - mb_ereg_replace)
$var0 = "e";
$var2 = "";
$var3 = NULL;
$var8 = mbereg_replace($var2,$var3,$var3,$var0);
$var8 = mb_ereg_replace($var2,$var3,$var3,$var0);
var_dump($var8);
?>
--EXPECTF--
Deprecated: mbereg_replace(): The 'e' option is deprecated, use mb_ereg_replace_callback instead in %s%ebug72164.php on line %d
Deprecated: mb_ereg_replace(): The 'e' option is deprecated, use mb_ereg_replace_callback instead in %s%ebug72164.php on line %d
string(0) ""
@@ -4,9 +4,9 @@ Bug #72399 (Use-After-Free in MBString (search_re))
<?php require 'skipif.inc'; ?>
--FILE--
<?php
$var5 = mbereg_search_init("","2");
$var5 = mb_ereg_search_init("","2");
$var6 = mb_eregi_replace("2","","");
$var13 = mbereg_search_pos();
$var13 = mb_ereg_search_pos();
?>
--EXPECTF--
Warning: mbereg_search_pos(): No regex given in %sbug72399.php on line %d
Warning: mb_ereg_search_pos(): No regex given in %sbug72399.php on line %d
@@ -3,17 +3,17 @@ Bug #72994 (mbc_to_code() out of bounds read)
--SKIPIF--
<?php
if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
if (!function_exists('mbereg_replace')) die('skip mbereg_replace() not available');
if (!function_exists('mb_ereg_replace')) die('skip mb_ereg_replace() not available');
?>
--FILE--
<?php
$var1 = mbereg_replace($var-232338951,NULL,NULL,NULL);
$var1 = mb_ereg_replace($var-232338951,NULL,NULL,NULL);
var_dump($var1);
?>
===DONE===
--EXPECTF--
Notice: Undefined variable: var in %s on line %d
Warning: mbereg_replace(): mbregex compile err: invalid code point value in %sbug72994.php on line %d
Warning: mb_ereg_replace(): mbregex compile err: invalid code point value in %sbug72994.php on line %d
bool(false)
===DONE===
@@ -1,18 +1,21 @@
--TEST--
mb_ereg() returning matches
--SKIPIF--
<?php if (!function_exists("mb_ereg")) print "skip"; ?>
<?php
if (!extension_loaded('mbstring')) die('skip mbstring not enabled');
if (!function_exists("mb_ereg")) print "skip mb_ereg() not available";
?>
--FILE--
<?php
$a = -1; $b = -1; $c = -1;
mbereg($a, $b, $c);
mb_ereg($a, $b, $c);
var_dump($a, $b, $c);
mberegi($a, $b, $c);
mb_eregi($a, $b, $c);
var_dump($a, $b, $c);
mbereg_search_init($a, $b, $c);
mb_ereg_search_init($a, $b, $c);
var_dump($a, $b, $c);
echo "Done\n";
@@ -31,7 +34,7 @@ array(1) {
string(2) "-1"
}
Warning: mbereg_search_init() expects parameter 3 to be string, array given in %s on line %d
Warning: mb_ereg_search_init() expects parameter 3 to be string, array given in %s on line %d
int(-1)
int(-1)
array(1) {
@@ -8,6 +8,9 @@ if (!function_exists("mb_ereg")) print "skip mb_ereg() not available";
--FILE--
<?php
// Note: This test is identical to mb_ereg2.phpt, but using deprecated mbereg_* aliases.
// Deleted it once the deprecated aliases have been removed.
$a = -1; $b = -1; $c = -1;
mbereg($a, $b, $c);
var_dump($a, $b, $c);
@@ -21,19 +24,24 @@ var_dump($a, $b, $c);
echo "Done\n";
?>
--EXPECTF--
Deprecated: Function mbereg() is deprecated in %s on line %d
int(-1)
int(-1)
array(1) {
[0]=>
string(2) "-1"
}
Deprecated: Function mberegi() is deprecated in %s on line %d
int(-1)
int(-1)
array(1) {
[0]=>
string(2) "-1"
}
Deprecated: Function mbereg_search_init() is deprecated in %s on line %d
Warning: mbereg_search_init() expects parameter 3 to be string, array given in %s on line %d
int(-1)
int(-1)
ProTip! Use n and p to navigate between commits in a pull request.