Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 414cff4

Browse files
committed
Merge branch '4.4' into 5.4
* 4.4: Use mb_convert_encoding instead of utf8_decode [FrameworkBundle] Always add CacheCollectorPass Fix "Notice: Undefined index: headers" in messenger with Oracle Indicate support for doctrine/persistence 3 Replace deprecated String.prototype.substr()
2 parents 7f37797 + 8d24d0a commit 414cff4

File tree

11 files changed

+20
-16
lines changed

11 files changed

+20
-16
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"ext-xml": "*",
3737
"friendsofphp/proxy-manager-lts": "^1.0.2",
3838
"doctrine/event-manager": "~1.0",
39-
"doctrine/persistence": "^2",
39+
"doctrine/persistence": "^2|^3",
4040
"twig/twig": "^2.13|^3.0.4",
4141
"psr/cache": "^1.0|^2.0",
4242
"psr/container": "^1.1.1",

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=7.2.5",
2020
"doctrine/event-manager": "~1.0",
21-
"doctrine/persistence": "^2",
21+
"doctrine/persistence": "^2|^3",
2222
"symfony/deprecation-contracts": "^2.1|^3",
2323
"symfony/polyfill-ctype": "~1.8",
2424
"symfony/polyfill-mbstring": "~1.0",

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ public function build(ContainerBuilder $container)
160160
$container->addCompilerPass(new RegisterReverseContainerPass(false), PassConfig::TYPE_AFTER_REMOVING);
161161
$container->addCompilerPass(new RemoveUnusedSessionMarshallingHandlerPass());
162162
$container->addCompilerPass(new SessionPass());
163+
$container->addCompilerPass(new CacheCollectorPass(), PassConfig::TYPE_BEFORE_REMOVING);
163164

164165
if ($container->getParameter('kernel.debug')) {
165166
$container->addCompilerPass(new AddDebugLogProcessorPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 2);
166167
$container->addCompilerPass(new UnusedTagsPass(), PassConfig::TYPE_AFTER_REMOVING);
167168
$container->addCompilerPass(new ContainerBuilderDebugDumpPass(), PassConfig::TYPE_BEFORE_REMOVING, -255);
168-
$container->addCompilerPass(new CacheCollectorPass(), PassConfig::TYPE_BEFORE_REMOVING);
169169
}
170170
}
171171

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"require-dev": {
3737
"doctrine/annotations": "^1.13.1",
3838
"doctrine/cache": "^1.11|^2.0",
39-
"doctrine/persistence": "^1.3|^2.0",
39+
"doctrine/persistence": "^1.3|^2|^3",
4040
"symfony/asset": "^5.3|^6.0",
4141
"symfony/browser-kit": "^5.4|^6.0",
4242
"symfony/console": "^5.4|^6.0",

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,13 +351,13 @@ if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') {
351351
352352
/* prevent logging AJAX calls to static and inline files, like templates */
353353
var path = url;
354-
if (url.substr(0, 1) === '/') {
354+
if (url.slice(0, 1) === '/') {
355355
if (0 === url.indexOf('{{ request.basePath|e('js') }}')) {
356-
path = url.substr({{ request.basePath|length }});
356+
path = url.slice({{ request.basePath|length }});
357357
}
358358
}
359359
else if (0 === url.indexOf('{{ (request.schemeAndHttpHost ~ request.basePath)|e('js') }}')) {
360-
path = url.substr({{ (request.schemeAndHttpHost ~ request.basePath)|length }});
360+
path = url.slice({{ (request.schemeAndHttpHost ~ request.basePath)|length }});
361361
}
362362
363363
if (!path.match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) {

src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function testSetContentDispositionGeneratesSafeFallbackFilenameForWrongly
9494
{
9595
$response = new BinaryFileResponse(__FILE__);
9696

97-
$iso88591EncodedFilename = utf8_decode('föö.html');
97+
$iso88591EncodedFilename = mb_convert_encoding('föö.html', 'ISO-8859-1', 'UTF-8');
9898
$response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $iso88591EncodedFilename);
9999

100100
// the parameter filename* is invalid in this case (rawurldecode('f%F6%F6') does not provide a UTF-8 string but an ISO-8859-1 encoded one)

src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/ConnectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ public function providePlatformSql(): iterable
401401

402402
yield 'Oracle' => [
403403
new OraclePlatform(),
404-
'SELECT w.* FROM messenger_messages w WHERE w.id IN(SELECT a.id FROM (SELECT m.* FROM messenger_messages m WHERE (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) AND (m.queue_name = ?) ORDER BY available_at ASC) a WHERE ROWNUM <= 1) FOR UPDATE',
404+
'SELECT w.id AS "id", w.body AS "body", w.headers AS "headers", w.queue_name AS "queue_name", w.created_at AS "created_at", w.available_at AS "available_at", w.delivered_at AS "delivered_at" FROM messenger_messages w WHERE w.id IN(SELECT a.id FROM (SELECT m.* FROM messenger_messages m WHERE (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) AND (m.queue_name = ?) ORDER BY available_at ASC) a WHERE ROWNUM <= 1) FOR UPDATE',
405405
];
406406
}
407407

src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ public function get(): ?array
189189
$sql = str_replace('SELECT a.* FROM', 'SELECT a.id FROM', $sql);
190190

191191
$wrappedQuery = $this->driverConnection->createQueryBuilder()
192-
->select('w.*')
192+
->select(
193+
'w.id AS "id", w.body AS "body", w.headers AS "headers", w.queue_name AS "queue_name", '.
194+
'w.created_at AS "created_at", w.available_at AS "available_at", '.
195+
'w.delivered_at AS "delivered_at"'
196+
)
193197
->from($this->configuration['table_name'], 'w')
194198
->where('w.id IN('.$sql.')');
195199

src/Symfony/Component/Messenger/Bridge/Doctrine/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"require-dev": {
2424
"doctrine/dbal": "^2.13|^3.0",
25-
"doctrine/persistence": "^1.3|^2",
25+
"doctrine/persistence": "^1.3|^2|^3",
2626
"symfony/property-access": "^4.4|^5.0|^6.0",
2727
"symfony/serializer": "^4.4|^5.0|^6.0"
2828
},

src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ public function testEncoding()
124124
$loader = new XliffFileLoader();
125125
$catalogue = $loader->load(__DIR__.'/../fixtures/encoding.xlf', 'en', 'domain1');
126126

127-
$this->assertEquals(utf8_decode('föö'), $catalogue->get('bar', 'domain1'));
128-
$this->assertEquals(utf8_decode('bär'), $catalogue->get('foo', 'domain1'));
127+
$this->assertEquals(mb_convert_encoding('föö', 'ISO-8859-1', 'UTF-8'), $catalogue->get('bar', 'domain1'));
128+
$this->assertEquals(mb_convert_encoding('bär', 'ISO-8859-1', 'UTF-8'), $catalogue->get('foo', 'domain1'));
129129
$this->assertEquals(
130130
[
131131
'source' => 'foo',
132-
'notes' => [['content' => utf8_decode('bäz')]],
132+
'notes' => [['content' => mb_convert_encoding('bäz', 'ISO-8859-1', 'UTF-8')]],
133133
'id' => '1',
134134
'file' => [
135135
'original' => 'file.ext',

src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ function xpathHasClass(className) {
369369
if (/\bsf-dump-toggle\b/.test(a.className)) {
370370
e.preventDefault();
371371
if (!toggle(a, isCtrlKey(e))) {
372-
var r = doc.getElementById(a.getAttribute('href').substr(1)),
372+
var r = doc.getElementById(a.getAttribute('href').slice(1)),
373373
s = r.previousSibling,
374374
f = r.parentNode,
375375
t = a.parentNode;
@@ -430,7 +430,7 @@ function xpathHasClass(className) {
430430
x += elt.parentNode.getAttribute('data-depth')/1;
431431
}
432432
} else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) {
433-
a = a.substr(1);
433+
a = a.slice(1);
434434
elt.className += ' '+a;
435435
436436
if (/[\[{]$/.test(elt.previousSibling.nodeValue)) {

0 commit comments

Comments
 (0)