-
-
Notifications
You must be signed in to change notification settings - Fork 452
PHP 8.5 support #4891
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
Merged
Merged
PHP 8.5 support #4891
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
7ec0600
Allow PHP 8.5
sreichel d43013a
workflow update
sreichel e3455d0
Merge branch 'main' into php85
sreichel 8a74749
Merge branch 'main' into php85
sreichel 51b08c5
Merge branch 'main' into php85
sreichel 5fac993
Merge branch 'main' into php85
sreichel 9237dcc
Updated composer.lock
sreichel 7f6d55c
Merge remote-tracking branch 'origin/php85' into php85
sreichel 809a9b4
Updated composer
sreichel 689294d
Updated composer packages
sreichel 4768a27
Merge branch 'main' into php85
addison74 021c9cd
Merge branch 'main' into php85
sreichel 7c23798
fixed deprecated errors
sreichel fe8a784
updated composer.lock
sreichel 9f83bbf
[skip ci] PHPUnit: corrected min php-version for workflow
sreichel de5aad4
...
sreichel de7caeb
minor
sreichel 03defa3
updated composer.lock
sreichel 30b2dce
Add vendor:patch command to composer.json
sreichel 3de9c16
Merge branch 'main' into php85
sreichel 4311d0f
Merge branch 'main' into php85
kiatng 78ecf62
Merge branch 'main' into php85
sreichel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ jobs: | |
|
|
||
| strategy: | ||
| matrix: | ||
| php: ['8.1', '8.4'] | ||
| php: ['8.1', '8.5'] | ||
|
|
||
| name: PHP Syntax ${{ matrix.php }} | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| From 8450a6e8c01f1f594641a53c45419e32e51fb749 Mon Sep 17 00:00:00 2001 | ||
| From: Fabrizio Balliano <fabrizio.balliano@gmail.com> | ||
| Date: Wed, 21 Feb 2024 19:35:08 +0000 | ||
| Subject: [PATCH] Fixed undefined array key "parenthesis_opener" | ||
|
|
||
| --- | ||
| Ecg/Sniffs/Performance/LoopSniff.php | 2 +- | ||
| 1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
|
||
| diff --git a/Ecg/Sniffs/Performance/LoopSniff.php b/Ecg/Sniffs/Performance/LoopSniff.php | ||
| index 3e9f9ec..3d4efed 100644 | ||
| --- a/Ecg/Sniffs/Performance/LoopSniff.php | ||
| +++ b/Ecg/Sniffs/Performance/LoopSniff.php | ||
| @@ -70,7 +70,7 @@ public function process(File $phpcsFile, $stackPtr) | ||
| return; | ||
| } | ||
|
|
||
| - for ($ptr = $tokens[$stackPtr]['parenthesis_opener'] + 1; $ptr < $tokens[$stackPtr]['scope_closer']; $ptr++) { | ||
| + for ($ptr = ($tokens[$stackPtr]['parenthesis_opener'] ?? 0) + 1; $ptr < $tokens[$stackPtr]['scope_closer']; $ptr++) { | ||
| $content = $tokens[$ptr]['content']; | ||
| if ($tokens[$ptr]['code'] !== T_STRING || in_array($ptr, $this->processedStackPointers)) { | ||
| continue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- /dev/null | ||
| +++ ../library/Zend/Mime.php | ||
| @@ -38,7 +38,7 @@ | ||
| public const ENCODING_BASE64 = 'base64'; | ||
| public const DISPOSITION_ATTACHMENT = 'attachment'; | ||
| public const DISPOSITION_INLINE = 'inline'; | ||
| - public const LINELENGTH = 72; | ||
| + public const LINELENGTH = 200; | ||
| public const LINEEND = "\n"; | ||
| public const MULTIPART_ALTERNATIVE = 'multipart/alternative'; | ||
| public const MULTIPART_MIXED = 'multipart/mixed'; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| --- /dev/null | ||
| +++ ../library/Zend/Validate/Hostname.php | ||
| @@ -2188,7 +2188,9 @@ | ||
| $this->_tld = $matches[1]; | ||
| if ($this->_options['tld']) { | ||
| if (!in_array(strtolower($this->_tld), $this->_validTlds) | ||
| - && !in_array($this->_tld, $this->_validTlds)) { | ||
| + && !in_array($this->_tld, $this->_validTlds) | ||
| + && !$this->checkDnsRecords($this->_value) | ||
| + ) { | ||
| $this->_error(self::UNKNOWN_TLD); | ||
| $status = false; | ||
| break; | ||
| @@ -2422,5 +2424,31 @@ | ||
| } | ||
|
|
||
| return implode('', $decoded); | ||
| + } | ||
| + | ||
| + /** | ||
| + * Returns true if any DNS records corresponding to a given Internet host are found. | ||
| + * Returns false if no DNS records were found or if an error occurred. | ||
| + * Checks A-Record. | ||
| + * | ||
| + * @param string $hostName | ||
| + * | ||
| + * @return bool | ||
| + */ | ||
| + protected function checkDnsRecords($hostName) | ||
| + { | ||
| + if (function_exists('idn_to_ascii')) { | ||
| + if (defined('IDNA_NONTRANSITIONAL_TO_ASCII') && defined('INTL_IDNA_VARIANT_UTS46')) { | ||
| + $toAscii = idn_to_ascii($hostName, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46); | ||
| + } else { | ||
| + $toAscii = idn_to_ascii($hostName); | ||
| + } | ||
| + $result = checkdnsrr($toAscii, 'A'); | ||
| + } else { | ||
| + $idn = new Net_IDNA2(); | ||
| + $result = checkdnsrr($idn->encode($hostName), 'A'); | ||
| + } | ||
| + | ||
| + return $result; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- /dev/null | ||
| +++ ../library/Zend/Form/Decorator/Form.php | ||
| @@ -129,6 +129,12 @@ | ||
| $attribs = $this->getOptions(); | ||
| $name = $form->getFullyQualifiedName(); | ||
| $attribs['id'] = $form->getId(); | ||
| + if ($helper == 'unserialize') { | ||
| + $filter = new Varien_Filter_FormElementName(true); | ||
| + if($filter->filter($name) != $name){ | ||
| + throw new Zend_Form_Exception(sprintf('Invalid element name:"%s"', $name)); | ||
| + } | ||
| + } | ||
| return $view->$helper($name, $attribs, $content); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- /dev/null | ||
| +++ ../library/Zend/Validate/EmailAddress.php | ||
| @@ -429,7 +429,9 @@ | ||
| // Quoted-string characters are: DQUOTE *(qtext/quoted-pair) DQUOTE | ||
| $qtext = '\x20-\x21\x23-\x5b\x5d-\x7e'; // %d32-33 / %d35-91 / %d93-126 | ||
| $quotedPair = '\x20-\x7e'; // %d92 %d32-126 | ||
| - if (preg_match('/^"(['. $qtext .']|\x5c[' . $quotedPair . '])*"$/', $this->localPart)) { | ||
| + if ((0 === (strcmp($this->localPart, strip_tags($this->localPart)))) | ||
| + && (0 === (strcmp($this->localPart, htmlspecialchars_decode($this->localPart)))) | ||
| + && (preg_match('/^"(['. $qtext .']|\x5c[' . $quotedPair . '])*"$/', $this->localPart))) { | ||
| $result = true; | ||
| } else { | ||
| $this->_error(self::DOT_ATOM); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- /dev/null | ||
| +++ ../library/Zend/Controller/Request/Http.php | ||
| @@ -1041,7 +1041,9 @@ | ||
| */ | ||
| public function getScheme() | ||
| { | ||
| - return ($this->getServer('HTTPS') == 'on') ? self::SCHEME_HTTPS : self::SCHEME_HTTP; | ||
| + return (strtolower((string)$this->getServer('HTTPS')) == 'on') || $this->getServer('HTTP_X_FORWARDED_PROTO') == 'https' ? | ||
| + self::SCHEME_HTTPS : | ||
| + self::SCHEME_HTTP; | ||
| } | ||
|
|
||
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- /dev/null | ||
| +++ ../library/Zend/Cloud/DocumentService/Adapter/WindowsAzure.php | ||
| @@ -525,7 +525,7 @@ | ||
| */ | ||
| protected function _validateKey($key) | ||
| { | ||
| - if (preg_match('@[/#?' . preg_quote('\\') . ']@', $key)) { | ||
| + if (preg_match('@[/#?' . preg_quote('\\', '@') . ']@', $key)) { | ||
| throw new Zend_Cloud_DocumentService_Exception('Invalid partition or row key provided; must not contain /, \\, #, or ? characters'); | ||
| } | ||
| } | ||
|
|
||
| --- /dev/null | ||
| +++ ../library/Zend/Db/Statement.php | ||
| @@ -185,11 +185,11 @@ | ||
| // e.g. \' or '' | ||
| $qe = $this->_adapter->quote($q); | ||
| $qe = substr($qe, 1, 2); | ||
| - $qe = preg_quote($qe); | ||
| + $qe = preg_quote($qe, '/'); | ||
| $escapeChar = substr($qe,0,1); | ||
| // remove 'foo\'bar' | ||
| if (!empty($q)) { | ||
| - $escapeChar = preg_quote($escapeChar); | ||
| + $escapeChar = preg_quote($escapeChar, '/'); | ||
| // this segfaults only after 65,000 characters instead of 9,000 | ||
| $sql = preg_replace("/$q([^$q{$escapeChar}]*|($qe)*)*$q/s", '', $sql); | ||
| } | ||
| @@ -207,7 +207,7 @@ | ||
| // e.g. \" or "" or \` | ||
| $de = $this->_adapter->quoteIdentifier($d); | ||
| $de = substr($de, 1, 2); | ||
| - $de = preg_quote($de); | ||
| + $de = preg_quote($de, '/'); | ||
| // Note: $de and $d where never used..., now they are: | ||
| $sql = preg_replace("/$d($de|\\\\{2}|[^$d])*$d/Us", '', $sql); | ||
| return $sql; | ||
|
|
||
| --- /dev/null | ||
| +++ ../library/Zend/Http/Cookie.php | ||
| @@ -396,7 +396,7 @@ | ||
|
|
||
| // Check for either exact match or suffix match | ||
| return ($cookieDomain == $host || | ||
| - preg_match('/\.' . preg_quote($cookieDomain) . '$/', $host)); | ||
| + preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $host)); | ||
| } | ||
|
|
||
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- /dev/null | ||
| +++ ../library/Zend/Date.php | ||
| @@ -541,7 +541,8 @@ | ||
| } | ||
|
|
||
| if (($part !== null) && !defined($part) | ||
| - && ($part != 'ee') && ($part != 'ss') && ($part != 'GG') && ($part != 'MM') && ($part != 'EE') && ($part != 'TT') | ||
| + && ($part !== 'ee') && ($part !== 'ss') && ($part !== 'GG') && ($part !== 'MM') && ($part !== 'EE') && ($part !== 'TT') | ||
| + && ($part !== 'U') && ($part !== 'X') && ($part !== 'c') | ||
| && Zend_Locale::isLocale($part, null, false)) { | ||
| $locale = $part; | ||
| $part = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- /dev/null | ||
| +++ ../library/Zend/Auth/Adapter/Http/Resolver/File.php | ||
| @@ -157,7 +157,7 @@ | ||
|
|
||
| // No real validation is done on the contents of the password file. The | ||
| // assumption is that we trust the administrators to keep it secure. | ||
| - while (($line = fgetcsv($fp, 512, ':')) !== false) { | ||
| + while (($line = fgetcsv($fp, 512, ':', '"', '\\')) !== false) { | ||
| if ($line[0] == $username && $line[1] == $realm) { | ||
| $password = $line[2]; | ||
| fclose($fp); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- /dev/null | ||
| +++ ../lib/mcrypt.php | ||
| @@ -585,7 +585,7 @@ | ||
| $mode = $td->getMode(); | ||
| switch ($mode) { | ||
| case 'cfb': | ||
| - case 'ofb'; | ||
| + case 'ofb': | ||
| return 'n' . strtoupper($mode); | ||
| case 'cfb8': | ||
| case 'ofb8': | ||
| @@ -793,7 +793,6 @@ | ||
| { | ||
| $reflectionObject = new \ReflectionObject($td); | ||
| $reflectionProperty = $reflectionObject->getProperty('key'); | ||
| - $reflectionProperty->setAccessible(true); // can be dropped in PHP 8.1.0+ | ||
| if (!strlen($reflectionProperty->getValue($td))) { | ||
| trigger_error('mcrypt_generic_deinit(): Could not terminate encryption specifier', E_USER_WARNING); | ||
| return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| --- /dev/null | ||
| +++ ../library/Zend/Locale/Data.php | ||
| @@ -75,6 +75,13 @@ | ||
| private static $_cacheDisabled = false; | ||
|
|
||
| /** | ||
| + * Internal cache, prevent repeated cache requests | ||
| + * | ||
| + * @var array | ||
| + */ | ||
| + private static $_localCache = []; | ||
| + | ||
| + /** | ||
| * Read the content from locale | ||
| * | ||
| * Can be called like: | ||
| @@ -335,8 +342,15 @@ | ||
|
|
||
| $val = urlencode((string) $val); | ||
| $id = self::_filterCacheId('Zend_LocaleL_' . $locale . '_' . $path . '_' . $val); | ||
| + | ||
| + // add runtime cache to avoid calling cache backend multiple times during one request | ||
| + if (isset(self::$_localCache[$id])) { | ||
| + return self::$_localCache[$id]; | ||
| + } | ||
| if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) { | ||
| - return unserialize($result); | ||
| + $result = unserialize($result); | ||
| + self::$_localCache[$id] = $result; | ||
| + return $result; | ||
| } | ||
|
|
||
| $temp = []; | ||
| @@ -946,11 +960,13 @@ | ||
| } | ||
|
|
||
| if (isset(self::$_cache)) { | ||
| + $data = serialize($temp); | ||
| if (self::$_cacheTags) { | ||
| - self::$_cache->save( serialize($temp), $id, ['Zend_Locale']); | ||
| + self::$_cache->save( $data, $id, ['Zend_Locale']); | ||
| } else { | ||
| - self::$_cache->save( serialize($temp), $id); | ||
| + self::$_cache->save( $data, $id); | ||
| } | ||
| + static::$_localCache[$id] = $temp; | ||
| } | ||
|
|
||
| return $temp; | ||
| @@ -984,8 +1000,15 @@ | ||
| } | ||
| $val = urlencode((string) $val); | ||
| $id = self::_filterCacheId('Zend_LocaleC_' . $locale . '_' . $path . '_' . $val); | ||
| + | ||
| + // add runtime cache to avoid calling cache backend multiple times during one request | ||
| + if (isset(self::$_localCache[$id])) { | ||
| + return self::$_localCache[$id]; | ||
| + } | ||
| if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) { | ||
| - return unserialize($result); | ||
| + $result = unserialize($result); | ||
| + self::$_localCache[$id] = $result; | ||
| + return $result; | ||
| } | ||
|
|
||
| switch(strtolower($path)) { | ||
| @@ -1499,11 +1522,13 @@ | ||
| $temp = current($temp); | ||
| } | ||
| if (isset(self::$_cache)) { | ||
| + $data = serialize($temp); | ||
| if (self::$_cacheTags) { | ||
| - self::$_cache->save( serialize($temp), $id, ['Zend_Locale']); | ||
| + self::$_cache->save( $data, $id, ['Zend_Locale']); | ||
| } else { | ||
| - self::$_cache->save( serialize($temp), $id); | ||
| + self::$_cache->save( $data, $id); | ||
| } | ||
| + static::$_localCache[$id] = $temp; | ||
| } | ||
|
|
||
| return $temp; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.