Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ddev/commands/web/vendor-patches
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
## Usage: vendor-patches
## Example: ddev vendor-patches

php vendor/bin/vendor-patches generate
php vendor/bin/vendor-patches generate --patches-folder=.vendor-patches "$@"
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1', '8.4']
php-versions: ['8.1', '8.5']
mysql-version: ['5.7', '8.0', '8.4']

services:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/syntax-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
php: ['8.1', '8.4']
php: ['8.1', '8.5']

name: PHP Syntax ${{ matrix.php }}

Expand Down
2 changes: 1 addition & 1 deletion .phpstan.dist.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ includes:
parameters:
phpVersion:
min: 80100
max: 80499
max: 80599
magentoRootPath: %currentWorkingDirectory%
fileExtensions:
- php
Expand Down
4 changes: 4 additions & 0 deletions .rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Rector\Php82\Rector as Php82;
use Rector\Php83\Rector as Php83;
use Rector\Php84\Rector as Php84;
use Rector\Php85\Rector as Php85;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\Privatization\Rector as Privatization;
use Rector\Renaming\Rector as Renaming;
Expand All @@ -39,6 +40,9 @@
__DIR__,
])
->withSkipPath(__DIR__ . '/vendor')
->withRules([
Php85\ArrayDimFetch\ArrayFirstLastRector::class,
])
->withSkip([
CodeQuality\Assign\CombinedAssignRector::class, # todo: TMP
CodeQuality\BooleanNot\SimplifyDeMorganBinaryRector::class,
Expand Down
22 changes: 22 additions & 0 deletions .vendor-patches/ECG-72.patch
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;
11 changes: 11 additions & 0 deletions .vendor-patches/MAG-1.1.1.patch
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';
45 changes: 45 additions & 0 deletions .vendor-patches/MAG-1.9.3.0.patch
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;
}
}
15 changes: 15 additions & 0 deletions .vendor-patches/MAG-1.9.3.7.patch
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);
}
}
13 changes: 13 additions & 0 deletions .vendor-patches/MAG-1.9.3.9.patch
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);
13 changes: 13 additions & 0 deletions .vendor-patches/OM-1081.patch
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;
}

/**
49 changes: 49 additions & 0 deletions .vendor-patches/OM-2047.patch
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));
}

/**
12 changes: 12 additions & 0 deletions .vendor-patches/OM-2050.patch
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;
11 changes: 11 additions & 0 deletions .vendor-patches/OM-4297.patch
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);
19 changes: 19 additions & 0 deletions .vendor-patches/OM-4891.patch
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;
82 changes: 82 additions & 0 deletions .vendor-patches/OM-918.patch
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;
Loading
Loading