Skip to content

Commit d305581

Browse files
Merge branch '4.3' into 4.4
* 4.3: [Cache] Fixed undefined variable in ArrayTrait [HttpClient] revert bad logic around JSON_THROW_ON_ERROR [HttpKernel] Fix handling non-catchable fatal errors Fix json-encoding when JSON_THROW_ON_ERROR is used [HttpFoundation] work around PHP 7.3 bug related to json_encode() [HttpClient] add $response->cancel() [Security] added support for updated \"distinguished name\" format in x509 authentication
2 parents a24f4db + e901494 commit d305581

File tree

21 files changed

+86
-83
lines changed

21 files changed

+86
-83
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"psr/container": "^1.0",
2727
"psr/link": "^1.0",
2828
"psr/log": "~1.0",
29-
"symfony/contracts": "^1.1.1",
29+
"symfony/contracts": "^1.1.3",
3030
"symfony/polyfill-ctype": "~1.8",
3131
"symfony/polyfill-intl-icu": "~1.0",
3232
"symfony/polyfill-intl-idn": "^1.10",

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ protected function describeContainerEnvVars(array $envs, array $options = [])
194194
private function writeData(array $data, array $options)
195195
{
196196
$flags = isset($options['json_encoding']) ? $options['json_encoding'] : 0;
197+
197198
$this->write(json_encode($data, $flags | JSON_PRETTY_PRINT)."\n");
198199
}
199200

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,9 +797,6 @@ private function registerDebugConfiguration(array $config, ContainerBuilder $con
797797
$container->setParameter('debug.error_handler.throw_at', 0);
798798
}
799799

800-
$definition->replaceArgument(4, $debug);
801-
$definition->replaceArgument(6, $debug);
802-
803800
if ($debug && class_exists(DebugProcessor::class)) {
804801
$definition = new Definition(DebugProcessor::class);
805802
$definition->setPublic(false);

src/Symfony/Bundle/FrameworkBundle/Resources/config/debug_prod.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
<argument type="service" id="logger" on-invalid="null" />
1919
<argument>null</argument><!-- Log levels map for enabled error levels -->
2020
<argument>%debug.error_handler.throw_at%</argument>
21-
<argument>true</argument>
21+
<argument>%kernel.debug%</argument>
2222
<argument type="service" id="debug.file_link_formatter"></argument>
23-
<argument>true</argument>
23+
<argument>%kernel.debug%</argument>
24+
<argument>%kernel.charset%</argument>
2425
</service>
2526

2627
<service id="debug.file_link_formatter" class="Symfony\Component\HttpKernel\Debug\FileLinkFormatter">

src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,6 @@
7272
<argument type="service" id="router" on-invalid="ignore" />
7373
</service>
7474

75-
<service id="http_exception_listener" class="Symfony\Component\HttpKernel\EventListener\ExceptionListener">
76-
<tag name="kernel.event_listener" event="kernel.exception" method="onKernelException" priority="-2048" />
77-
<tag name="kernel.reset" method="reset" />
78-
<argument>null</argument>
79-
<argument>null</argument>
80-
<argument>%kernel.debug%</argument>
81-
<argument>%kernel.charset%</argument>
82-
<argument>%debug.file_link_format%</argument>
83-
</service>
84-
8575
<service id="validate_request_listener" class="Symfony\Component\HttpKernel\EventListener\ValidateRequestListener">
8676
<tag name="kernel.event_subscriber" />
8777
</service>

src/Symfony/Component/Cache/Traits/ArrayTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private function freeze($value, $key)
129129
} catch (\Exception $e) {
130130
$type = \is_object($value) ? \get_class($value) : \gettype($value);
131131
$message = sprintf('Failed to save key "{key}" of type %s: %s', $type, $e->getMessage());
132-
CacheItem::log($this->logger, $message, ['key' => substr($id, \strlen($this->namespace)), 'exception' => $e]);
132+
CacheItem::log($this->logger, $message, ['key' => $key, 'exception' => $e]);
133133

134134
return;
135135
}

src/Symfony/Component/Console/Descriptor/JsonDescriptor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ protected function describeApplication(Application $application, array $options
9797
*/
9898
private function writeData(array $data, array $options)
9999
{
100-
$this->write(json_encode($data, isset($options['json_encoding']) ? $options['json_encoding'] : 0));
100+
$flags = isset($options['json_encoding']) ? $options['json_encoding'] : 0;
101+
102+
$this->write(json_encode($data, $flags));
101103
}
102104

103105
/**

src/Symfony/Component/Form/Console/Descriptor/JsonDescriptor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ protected function describeOption(OptionsResolver $optionsResolver, array $optio
9494

9595
private function writeData(array $data, array $options)
9696
{
97-
$flags = $options['json_encoding'] ?? 0;
97+
$flags = isset($options['json_encoding']) ? $options['json_encoding'] : 0;
98+
9899
$this->output->write(json_encode($data, $flags | JSON_PRETTY_PRINT)."\n");
99100
}
100101

src/Symfony/Component/HttpClient/HttpClientTrait.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,7 @@ private static function jsonEncode($value, int $flags = null, int $maxDepth = 51
301301
}
302302

303303
try {
304-
if (\PHP_VERSION_ID >= 70300) {
305-
// Work around https://bugs.php.net/77997
306-
json_encode(null);
307-
$flags |= JSON_THROW_ON_ERROR;
308-
}
309-
310-
$value = json_encode($value, $flags, $maxDepth);
304+
$value = json_encode($value, $flags | (\PHP_VERSION_ID >= 70300 ? \JSON_THROW_ON_ERROR : 0), $maxDepth);
311305
} catch (\JsonException $e) {
312306
throw new InvalidArgumentException(sprintf('Invalid value for "json" option: %s.', $e->getMessage()));
313307
}

src/Symfony/Component/HttpClient/Response/ResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function toArray(bool $throw = true): array
148148
}
149149

150150
try {
151-
$content = json_decode($content, true, 512, JSON_BIGINT_AS_STRING | (\PHP_VERSION_ID >= 70300 ? JSON_THROW_ON_ERROR : 0));
151+
$content = json_decode($content, true, 512, JSON_BIGINT_AS_STRING | (\PHP_VERSION_ID >= 70300 ? \JSON_THROW_ON_ERROR : 0));
152152
} catch (\JsonException $e) {
153153
throw new JsonException($e->getMessage(), $e->getCode());
154154
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy