Skip to content

Commit 0f9749a

Browse files
chore(autoloader): Dump autoloader
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent 51cef89 commit 0f9749a

File tree

4 files changed

+71
-35
lines changed

4 files changed

+71
-35
lines changed

composer/InstalledVersions.php

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ class InstalledVersions
3232
*/
3333
private static $installed;
3434

35+
/**
36+
* @var bool
37+
*/
38+
private static $installedIsLocalDir;
39+
3540
/**
3641
* @var bool|null
3742
*/
@@ -309,6 +314,12 @@ public static function reload($data)
309314
{
310315
self::$installed = $data;
311316
self::$installedByVendor = array();
317+
318+
// when using reload, we disable the duplicate protection to ensure that self::$installed data is
319+
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
320+
// so we have to assume it does not, and that may result in duplicate data being returned when listing
321+
// all installed packages for example
322+
self::$installedIsLocalDir = false;
312323
}
313324

314325
/**
@@ -322,19 +333,27 @@ private static function getInstalled()
322333
}
323334

324335
$installed = array();
336+
$copiedLocalDir = false;
325337

326338
if (self::$canGetVendors) {
339+
$selfDir = strtr(__DIR__, '\\', '/');
327340
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
341+
$vendorDir = strtr($vendorDir, '\\', '/');
328342
if (isset(self::$installedByVendor[$vendorDir])) {
329343
$installed[] = self::$installedByVendor[$vendorDir];
330344
} elseif (is_file($vendorDir.'/composer/installed.php')) {
331345
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
332346
$required = require $vendorDir.'/composer/installed.php';
333-
$installed[] = self::$installedByVendor[$vendorDir] = $required;
334-
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
335-
self::$installed = $installed[count($installed) - 1];
347+
self::$installedByVendor[$vendorDir] = $required;
348+
$installed[] = $required;
349+
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
350+
self::$installed = $required;
351+
self::$installedIsLocalDir = true;
336352
}
337353
}
354+
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
355+
$copiedLocalDir = true;
356+
}
338357
}
339358
}
340359

@@ -350,7 +369,7 @@ private static function getInstalled()
350369
}
351370
}
352371

353-
if (self::$installed !== array()) {
372+
if (self::$installed !== array() && !$copiedLocalDir) {
354373
$installed[] = self::$installed;
355374
}
356375

composer/installed.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4595,31 +4595,31 @@
45954595
},
45964596
{
45974597
"name": "symfony/deprecation-contracts",
4598-
"version": "v3.5.0",
4599-
"version_normalized": "3.5.0.0",
4598+
"version": "v3.5.1",
4599+
"version_normalized": "3.5.1.0",
46004600
"source": {
46014601
"type": "git",
46024602
"url": "https://github.com/symfony/deprecation-contracts.git",
4603-
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1"
4603+
"reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6"
46044604
},
46054605
"dist": {
46064606
"type": "zip",
4607-
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
4608-
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
4607+
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
4608+
"reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
46094609
"shasum": ""
46104610
},
46114611
"require": {
46124612
"php": ">=8.1"
46134613
},
4614-
"time": "2024-04-18T09:32:20+00:00",
4614+
"time": "2024-09-25T14:20:29+00:00",
46154615
"type": "library",
46164616
"extra": {
4617+
"thanks": {
4618+
"url": "https://github.com/symfony/contracts",
4619+
"name": "symfony/contracts"
4620+
},
46174621
"branch-alias": {
46184622
"dev-main": "3.5-dev"
4619-
},
4620-
"thanks": {
4621-
"name": "symfony/contracts",
4622-
"url": "https://github.com/symfony/contracts"
46234623
}
46244624
},
46254625
"installation-source": "dist",
@@ -4645,7 +4645,7 @@
46454645
"description": "A generic function and convention to trigger deprecation notices",
46464646
"homepage": "https://symfony.com",
46474647
"support": {
4648-
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0"
4648+
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1"
46494649
},
46504650
"funding": [
46514651
{
@@ -4897,17 +4897,17 @@
48974897
},
48984898
{
48994899
"name": "symfony/http-foundation",
4900-
"version": "v6.4.12",
4901-
"version_normalized": "6.4.12.0",
4900+
"version": "v6.4.14",
4901+
"version_normalized": "6.4.14.0",
49024902
"source": {
49034903
"type": "git",
49044904
"url": "https://github.com/symfony/http-foundation.git",
4905-
"reference": "133ac043875f59c26c55e79cf074562127cce4d2"
4905+
"reference": "ba020a321a95519303a3f09ec2824d34d601c388"
49064906
},
49074907
"dist": {
49084908
"type": "zip",
4909-
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/133ac043875f59c26c55e79cf074562127cce4d2",
4910-
"reference": "133ac043875f59c26c55e79cf074562127cce4d2",
4909+
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/ba020a321a95519303a3f09ec2824d34d601c388",
4910+
"reference": "ba020a321a95519303a3f09ec2824d34d601c388",
49114911
"shasum": ""
49124912
},
49134913
"require": {
@@ -4929,7 +4929,7 @@
49294929
"symfony/mime": "^5.4|^6.0|^7.0",
49304930
"symfony/rate-limiter": "^5.4|^6.0|^7.0"
49314931
},
4932-
"time": "2024-09-20T08:18:25+00:00",
4932+
"time": "2024-11-05T16:39:55+00:00",
49334933
"type": "library",
49344934
"installation-source": "dist",
49354935
"autoload": {
@@ -4957,7 +4957,7 @@
49574957
"description": "Defines an object-oriented layer for the HTTP specification",
49584958
"homepage": "https://symfony.com",
49594959
"support": {
4960-
"source": "https://github.com/symfony/http-foundation/tree/v6.4.12"
4960+
"source": "https://github.com/symfony/http-foundation/tree/v6.4.14"
49614961
},
49624962
"funding": [
49634963
{
@@ -5507,8 +5507,8 @@
55075507
"type": "library",
55085508
"extra": {
55095509
"thanks": {
5510-
"name": "symfony/polyfill",
5511-
"url": "https://github.com/symfony/polyfill"
5510+
"url": "https://github.com/symfony/polyfill",
5511+
"name": "symfony/polyfill"
55125512
}
55135513
},
55145514
"installation-source": "dist",
@@ -5584,8 +5584,8 @@
55845584
"type": "library",
55855585
"extra": {
55865586
"thanks": {
5587-
"name": "symfony/polyfill",
5588-
"url": "https://github.com/symfony/polyfill"
5587+
"url": "https://github.com/symfony/polyfill",
5588+
"name": "symfony/polyfill"
55895589
}
55905590
},
55915591
"installation-source": "dist",
@@ -5667,8 +5667,8 @@
56675667
"type": "library",
56685668
"extra": {
56695669
"thanks": {
5670-
"name": "symfony/polyfill",
5671-
"url": "https://github.com/symfony/polyfill"
5670+
"url": "https://github.com/symfony/polyfill",
5671+
"name": "symfony/polyfill"
56725672
}
56735673
},
56745674
"installation-source": "dist",

composer/installed.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,9 @@
671671
'dev_requirement' => false,
672672
),
673673
'symfony/deprecation-contracts' => array(
674-
'pretty_version' => 'v3.5.0',
675-
'version' => '3.5.0.0',
676-
'reference' => '0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1',
674+
'pretty_version' => 'v3.5.1',
675+
'version' => '3.5.1.0',
676+
'reference' => '74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6',
677677
'type' => 'library',
678678
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
679679
'aliases' => array(),
@@ -713,9 +713,9 @@
713713
),
714714
),
715715
'symfony/http-foundation' => array(
716-
'pretty_version' => 'v6.4.12',
717-
'version' => '6.4.12.0',
718-
'reference' => '133ac043875f59c26c55e79cf074562127cce4d2',
716+
'pretty_version' => 'v6.4.14',
717+
'version' => '6.4.14.0',
718+
'reference' => 'ba020a321a95519303a3f09ec2824d34d601c388',
719719
'type' => 'library',
720720
'install_path' => __DIR__ . '/../symfony/http-foundation',
721721
'aliases' => array(),

symfony/http-foundation/Request.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\HttpFoundation;
1313

14+
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
1415
use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException;
1516
use Symfony\Component\HttpFoundation\Exception\JsonException;
1617
use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException;
@@ -326,6 +327,8 @@ public static function createFromGlobals(): static
326327
* @param array $files The request files ($_FILES)
327328
* @param array $server The server parameters ($_SERVER)
328329
* @param string|resource|null $content The raw body data
330+
*
331+
* @throws BadRequestException When the URI is invalid
329332
*/
330333
public static function create(string $uri, string $method = 'GET', array $parameters = [], array $cookies = [], array $files = [], array $server = [], $content = null): static
331334
{
@@ -354,6 +357,20 @@ public static function create(string $uri, string $method = 'GET', array $parame
354357
unset($components['fragment']);
355358
}
356359

360+
if (false === $components) {
361+
throw new BadRequestException('Invalid URI.');
362+
}
363+
364+
if (false !== ($i = strpos($uri, '\\')) && $i < strcspn($uri, '?#')) {
365+
throw new BadRequestException('Invalid URI: A URI cannot contain a backslash.');
366+
}
367+
if (\strlen($uri) !== strcspn($uri, "\r\n\t")) {
368+
throw new BadRequestException('Invalid URI: A URI cannot contain CR/LF/TAB characters.');
369+
}
370+
if ('' !== $uri && (\ord($uri[0]) <= 32 || \ord($uri[-1]) <= 32)) {
371+
throw new BadRequestException('Invalid URI: A URI must not start nor end with ASCII control characters or spaces.');
372+
}
373+
357374
if (isset($components['host'])) {
358375
$server['SERVER_NAME'] = $components['host'];
359376
$server['HTTP_HOST'] = $components['host'];
@@ -1231,7 +1248,7 @@ public function getMethod(): string
12311248
}
12321249

12331250
if (!preg_match('/^[A-Z]++$/D', $method)) {
1234-
throw new SuspiciousOperationException(sprintf('Invalid method override "%s".', $method));
1251+
throw new SuspiciousOperationException('Invalid HTTP method override.');
12351252
}
12361253

12371254
return $this->method = $method;

0 commit comments

Comments
 (0)