[Web] Update libs

This commit is contained in:
andryyy
2021-05-23 13:20:53 +02:00
parent e6d5516c7f
commit 8779a1a873
48 changed files with 656 additions and 272 deletions

View File

@@ -134,7 +134,7 @@ class XliffFileLoader implements LoaderInterface
private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain)
{
$xml = simplexml_import_dom($dom);
$encoding = strtoupper($dom->encoding);
$encoding = $dom->encoding ? strtoupper($dom->encoding) : null;
$xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:2.0');

View File

@@ -446,7 +446,7 @@ EOF
*/
protected function assertValidLocale(string $locale)
{
if (1 !== preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) {
if (null !== $locale && 1 !== preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) {
throw new InvalidArgumentException(sprintf('Invalid "%s" locale.', $locale));
}
}