Merge branch '5.4' into 5.5
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 17 Apr 2023 17:20:13 +0000 (19:20 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 17 Apr 2023 17:20:13 +0000 (19:20 +0200)
1  2 
wcfsetup/install/files/lib/system/api/composer.lock
wcfsetup/install/files/lib/system/api/composer/installed.json
wcfsetup/install/files/lib/system/api/composer/installed.php
wcfsetup/install/files/lib/system/api/guzzlehttp/psr7/CHANGELOG.md
wcfsetup/install/files/lib/system/api/guzzlehttp/psr7/README.md
wcfsetup/install/files/lib/system/api/guzzlehttp/psr7/composer.json
wcfsetup/install/files/lib/system/api/guzzlehttp/psr7/src/LazyOpenStream.php
wcfsetup/install/files/lib/system/api/guzzlehttp/psr7/src/Message.php
wcfsetup/install/files/lib/system/api/guzzlehttp/psr7/src/MessageTrait.php
wcfsetup/install/files/lib/system/api/guzzlehttp/psr7/src/ServerRequest.php

index f82859bc0a6d136b434e4fbc758c0734915c40f4,3422fabf92624b15621e7955e50dab914bf54600..bd5a5d26bb49ef4536fe28b75baa66a8e2418330
          },
          {
              "name": "guzzlehttp/psr7",
-             "version": "2.4.3",
 -            "version": "1.9.1",
++            "version": "2.4.5",
              "source": {
                  "type": "git",
                  "url": "https://github.com/guzzle/psr7.git",
-                 "reference": "67c26b443f348a51926030c83481b85718457d3d"
 -                "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b"
++                "reference": "0454e12ef0cd597ccd2adb036f7bda4e7fface66"
              },
              "dist": {
                  "type": "zip",
-                 "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d",
-                 "reference": "67c26b443f348a51926030c83481b85718457d3d",
 -                "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b",
 -                "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b",
++                "url": "https://api.github.com/repos/guzzle/psr7/zipball/0454e12ef0cd597ccd2adb036f7bda4e7fface66",
++                "reference": "0454e12ef0cd597ccd2adb036f7bda4e7fface66",
                  "shasum": ""
              },
              "require": {
                  "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
              },
              "type": "library",
-                 },
-                 "branch-alias": {
-                     "dev-master": "2.4-dev"
 +            "extra": {
 +                "bamarni-bin": {
 +                    "bin-links": true,
 +                    "forward-command": false
 +                }
 +            },
              "autoload": {
 -                "files": [
 -                    "src/functions_include.php"
 -                ],
                  "psr-4": {
                      "GuzzleHttp\\Psr7\\": "src/"
                  }
              ],
              "support": {
                  "issues": "https://github.com/guzzle/psr7/issues",
-                 "source": "https://github.com/guzzle/psr7/tree/2.4.3"
 -                "source": "https://github.com/guzzle/psr7/tree/1.9.1"
++                "source": "https://github.com/guzzle/psr7/tree/2.4.5"
              },
              "funding": [
                  {
                      "type": "tidelift"
                  }
              ],
-             "time": "2022-10-26T14:07:24+00:00"
 -            "time": "2023-04-17T16:00:37+00:00"
++            "time": "2023-04-17T16:00:45+00:00"
          },
          {
 -            "name": "paragonie/constant_time_encoding",
 -            "version": "v2.4.0",
 +            "name": "laminas/laminas-diactoros",
 +            "version": "2.4.1",
              "source": {
                  "type": "git",
 -                "url": "https://github.com/paragonie/constant_time_encoding.git",
 -                "reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c"
 +                "url": "https://github.com/laminas/laminas-diactoros.git",
 +                "reference": "36ef09b73e884135d2059cc498c938e90821bb57"
              },
              "dist": {
                  "type": "zip",
index f3fc8279f77dc9bc1a3604847771f75f0d8755c3,4c147f8c2a8755b37c1f70e5fc71987db842320b..aa34b5d98ff927c94ea9208eff42b456baa2ba9e
          },
          {
              "name": "guzzlehttp/psr7",
-             "version": "2.4.3",
-             "version_normalized": "2.4.3.0",
 -            "version": "1.9.1",
 -            "version_normalized": "1.9.1.0",
++            "version": "2.4.5",
++            "version_normalized": "2.4.5.0",
              "source": {
                  "type": "git",
                  "url": "https://github.com/guzzle/psr7.git",
-                 "reference": "67c26b443f348a51926030c83481b85718457d3d"
 -                "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b"
++                "reference": "0454e12ef0cd597ccd2adb036f7bda4e7fface66"
              },
              "dist": {
                  "type": "zip",
-                 "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d",
-                 "reference": "67c26b443f348a51926030c83481b85718457d3d",
 -                "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b",
 -                "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b",
++                "url": "https://api.github.com/repos/guzzle/psr7/zipball/0454e12ef0cd597ccd2adb036f7bda4e7fface66",
++                "reference": "0454e12ef0cd597ccd2adb036f7bda4e7fface66",
                  "shasum": ""
              },
              "require": {
              "suggest": {
                  "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
              },
-             "time": "2022-10-26T14:07:24+00:00",
 -            "time": "2023-04-17T16:00:37+00:00",
++            "time": "2023-04-17T16:00:45+00:00",
              "type": "library",
-                 },
-                 "branch-alias": {
-                     "dev-master": "2.4-dev"
 +            "extra": {
 +                "bamarni-bin": {
 +                    "bin-links": true,
 +                    "forward-command": false
 +                }
 +            },
              "installation-source": "dist",
              "autoload": {
 -                "files": [
 -                    "src/functions_include.php"
 -                ],
                  "psr-4": {
                      "GuzzleHttp\\Psr7\\": "src/"
                  }
              ],
              "support": {
                  "issues": "https://github.com/guzzle/psr7/issues",
-                 "source": "https://github.com/guzzle/psr7/tree/2.4.3"
 -                "source": "https://github.com/guzzle/psr7/tree/1.9.1"
++                "source": "https://github.com/guzzle/psr7/tree/2.4.5"
              },
              "funding": [
                  {
index f55b81054854e799841cd35080295035be3bb6fa,63278036b2c9fad19b01c805f703aacd7d01413e..40041e6ab7adad4163db19a0c2841970741ca7f9
@@@ -65,9 -67,9 +65,9 @@@
              'dev_requirement' => false,
          ),
          'guzzlehttp/psr7' => array(
-             'pretty_version' => '2.4.3',
-             'version' => '2.4.3.0',
-             'reference' => '67c26b443f348a51926030c83481b85718457d3d',
 -            'pretty_version' => '1.9.1',
 -            'version' => '1.9.1.0',
 -            'reference' => 'e4490cabc77465aaee90b20cfc9a770f8c04be6b',
++            'pretty_version' => '2.4.5',
++            'version' => '2.4.5.0',
++            'reference' => '0454e12ef0cd597ccd2adb036f7bda4e7fface66',
              'type' => 'library',
              'install_path' => __DIR__ . '/../guzzlehttp/psr7',
              'aliases' => array(),
index 3fcf18a5430a86bd1fa76864001e27f37a9b14ba,9b2b65cdb8abea2404bb253026663f5ea70091e9..49e0c12a47846b150d4fa39a031d209ccf91ac73
@@@ -5,27 -6,16 +5,41 @@@ All notable changes to this project wil
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
  
 -
  ## Unreleased
  
 -## 1.9.1 - 2023-04-17
++## 2.4.5 - 2023-04-17
+ ### Fixed
++- Prevent possible warnings on unset variables in `ServerRequest::normalizeNestedFileSpec`
++- Fixed `Message::bodySummary` when `preg_match` fails
+ - Fixed header validation issue
 -## 1.9.0 - 2022-06-20
++## 2.4.4 - 2023-03-09
++
++### Changed
++
++- Removed the need for `AllowDynamicProperties` in `LazyOpenStream`
++
 +## 2.4.3 - 2022-10-26
 +
 +### Changed
 +
 +- Replaced `sha1(uniqid())` by `bin2hex(random_bytes(20))`
 +
 +## 2.4.2 - 2022-10-25
 +
 +### Fixed
 +
 +- Fixed erroneous behaviour when combining host and relative path
 +
 +## 2.4.1 - 2022-08-28
 +
 +### Fixed
 +
 +- Rewind body before reading in `Message::bodySummary`
 +
 +## 2.4.0 - 2022-06-20
  
  ### Added
  
index 8b9929a1d0b1975b5523fa981f71b8a99f28b74f,64776cb665581e9955a3ce57299c5a543a2f2968..9566a7d47202197b441b798a85a98bdb765fcb7b
@@@ -4,10 -4,10 +4,16 @@@ This repository contains a full [PSR-7]
  message implementation, several stream decorators, and some helpful
  functionality like query string parsing.
  
 +![CI](https://github.com/guzzle/psr7/workflows/CI/badge.svg)
 +![Static analysis](https://github.com/guzzle/psr7/workflows/Static%20analysis/badge.svg)
  
 -[![Build Status](https://travis-ci.org/guzzle/psr7.svg?branch=master)](https://travis-ci.org/guzzle/psr7)
  
++# Installation
++
++```shell
++composer require guzzlehttp/psr7
++```
  # Stream implementation
  
  This package comes with a number of stream implementations and stream
@@@ -245,6 -246,6 +251,8 @@@ class EofCallbackStream implements Stre
  
      private $callback;
  
++    private $stream;
++
      public function __construct(StreamInterface $stream, callable $cb)
      {
          $this->stream = $stream;
index cd91040cf8ecf3a639614b1d8f9265a9899251cc,2607f22d48fc633ac5e57e657b6ae246acd03928..c0e7236c3eb2fd3c200b9ed0974bc7796695414e
              "GuzzleHttp\\Tests\\Psr7\\": "tests/"
          }
      },
-         },
-         "branch-alias": {
-             "dev-master": "2.4-dev"
 +    "extra": {
 +        "bamarni-bin": {
 +            "bin-links": true,
 +            "forward-command": false
 +        }
 +    },
      "config": {
 -        "preferred-install": "dist",
 -        "sort-packages": true,
          "allow-plugins": {
              "bamarni/composer-bin-plugin": true
 -        }
 +        },
 +        "preferred-install": "dist",
 +        "sort-packages": true
      }
  }
index 5618331f132ce0cb9dbc16157c3d303bec5c4f13,911e127d318eca5b94f6454e11021fec1d42cacb..f6c84904ed0d4d1e35e2bf0471069e506ac14f73
@@@ -9,9 -7,10 +9,8 @@@ use Psr\Http\Message\StreamInterface
  /**
   * Lazily reads or writes to a file that is opened only after an IO operation
   * take place on the stream.
 - *
 - * @final
   */
- #[\AllowDynamicProperties]
 -class LazyOpenStream implements StreamInterface
 +final class LazyOpenStream implements StreamInterface
  {
      use StreamDecoratorTrait;
  
      /** @var string */
      private $mode;
  
++    /**
++     * @var StreamInterface
++     */
++    private $stream;
++
      /**
       * @param string $filename File to lazily open
       * @param string $mode     fopen mode to use when opening the stream
      {
          $this->filename = $filename;
          $this->mode = $mode;
++
++        // unsetting the property forces the first access to go through
++        // __get().
++        unset($this->stream);
      }
  
      /**
index 61c1a5dccfb2fe8df67cae0125db4253b1fe2669,516d1cb84acddf4598be90c57dbe216dff1063f6..c1e15f8267a890905d30e5593a207bdbbdd94690
@@@ -77,7 -78,7 +77,7 @@@ final class Messag
  
          // Matches any printable character, including unicode characters:
          // letters, marks, numbers, punctuation, spacing, and separators.
--        if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) {
++        if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary) !== 0) {
              return null;
          }
  
index d2dc28b602ada1466d46c523ef2cf74df8467762,0bbd63e0d6084e0c4c803b9d41443e4579d32336..464bdfaa406b22a938f84bde2d26ad346a8f33ec
@@@ -224,12 -222,13 +224,9 @@@ trait MessageTrai
              ));
          }
  
-         if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header)) {
 -        if ($header === '') {
 -            throw new \InvalidArgumentException('Header name can not be empty.');
 -        }
 -
+         if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) {
              throw new \InvalidArgumentException(
-                 sprintf(
-                     '"%s" is not valid header name',
-                     $header
-                 )
+                 sprintf('"%s" is not valid header name.', $header)
              );
          }
      }
index 43cbb502e84d1ea45a02779f2681402b02643155,e6d26f5ff9a4e22c39e45ac2462a00b4849ba1bc..b2aa382dadc8104b7333c910f0463f19ae41fce1
@@@ -144,10 -146,10 +144,10 @@@ class ServerRequest extends Request imp
          foreach (array_keys($files['tmp_name']) as $key) {
              $spec = [
                  'tmp_name' => $files['tmp_name'][$key],
--                'size'     => $files['size'][$key],
--                'error'    => $files['error'][$key],
--                'name'     => $files['name'][$key],
--                'type'     => $files['type'][$key],
++                'size'     => $files['size'][$key] ?? null,
++                'error'    => $files['error'][$key] ?? null,
++                'name'     => $files['name'][$key] ?? null,
++                'type'     => $files['type'][$key] ?? null,
              ];
              $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec);
          }