8000 minor #41562 [Translation] Don't pass null to strtoupper() (derrabus) · symfony/symfony@b87de42 · GitHub
[go: up one dir, main page]

Skip to content

Commit b87de42

Browse files
minor #41562 [Translation] Don't pass null to strtoupper() (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- [Translation] Don't pass null to strtoupper() | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Part of #41552 | License | MIT | Doc PR | N/A This error popped up on 5.3, but not on 4.4. That's why I missed it when fixing the other occurrence with #41240. Commits ------- 3c8cf9a [Translation] Don't pass null to strtoupper()
2 parents 5854a82 + 3c8cf9a commit b87de42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Translation/Loader/XliffFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private function extract($resource, MessageCatalogue $catalogue, string $domain)
7676
private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain)
7777
{
7878
$xml = simplexml_import_dom($dom);
79-
$encoding = strtoupper($dom->encoding);
79+
$encoding = $dom->encoding ? strtoupper($dom->encoding) : null;
8080

8181
$namespace = 'urn:oasis:names:tc:xliff:document:1.2';
8282
$xml->registerXPathNamespace('xliff', $namespace);

0 commit comments

Comments
 (0)
0