From c91671f17634fdc98ce7d780e6f4dcb00b51bf71 Mon Sep 17 00:00:00 2001 From: yangming Date: Wed, 29 Sep 2021 11:26:25 +0800 Subject: [PATCH 1/2] mbstring.func_overload is deprecated in php 6.2 and removed in php 8.0 --- phpseclib/bootstrap.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpseclib/bootstrap.php b/phpseclib/bootstrap.php index 0da0999f..92613a01 100644 --- a/phpseclib/bootstrap.php +++ b/phpseclib/bootstrap.php @@ -7,7 +7,8 @@ if (extension_loaded('mbstring')) { // 2 - MB_OVERLOAD_STRING - if (ini_get('mbstring.func_overload') & 2) { + // mbstring.func_overload is deprecated in php 7.2 and removed in php 8.0. + if ((PHP_VERSION_ID < 80000) && ini_get('mbstring.func_overload') & 2) { throw new \UnexpectedValueException( 'Overloading of string functions using mbstring.func_overload ' . 'is not supported by phpseclib.' From 31eac618207153f1bb4c9c49c7da52ef60b8af37 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Wed, 10 Nov 2021 19:45:31 -0600 Subject: [PATCH 2/2] Bootstrap: use version_compare instead of PHP_VERSION_ID --- phpseclib/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/bootstrap.php b/phpseclib/bootstrap.php index 92613a01..547688f9 100644 --- a/phpseclib/bootstrap.php +++ b/phpseclib/bootstrap.php @@ -8,7 +8,7 @@ if (extension_loaded('mbstring')) { // 2 - MB_OVERLOAD_STRING // mbstring.func_overload is deprecated in php 7.2 and removed in php 8.0. - if ((PHP_VERSION_ID < 80000) && ini_get('mbstring.func_overload') & 2) { + if (version_compare(PHP_VERSION, '8.0.0') < 0 && ini_get('mbstring.func_overload') & 2) { throw new \UnexpectedValueException( 'Overloading of string functions using mbstring.func_overload ' . 'is not supported by phpseclib.'