Skip to content

Commit

Permalink
Fix zend-i18n compatibility for PHP 7.4 (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati authored Nov 2, 2023
1 parent 9698d04 commit 4a564d5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
"zendframework/zend-http:2.6.0": {
"Remove support for the X-Original-Url and X-Rewrite-Url headers": "zendframework/zend-http/no-x-original-url-x-rewrite.patch"
},
"zendframework/zend-i18n:2.7.3": {
"Add support for PHP 7.4 to Gettext Loader": "zendframework/zend-i18n/gettext-loader-php7.4.patch"
},
"zendframework/zend-mail:2.7.3": {
"Fix idn_to_ascii deprecation warning": "zendframework/zend-mail/fix-idn_to_ascii-deprecation-warning.patch"
},
Expand Down
15 changes: 15 additions & 0 deletions zendframework/zend-i18n/gettext-loader-php7.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
From: Michele Locati <michele@locati.it>
Date: Thu, 2 Nov 2023 12:31:03 +0100
Subject: [PATCH] Let Gettext loader support PHP 7.4

--- a/src/Translator/Loader/Gettext.php
+++ b/src/Translator/Loader/Gettext.php
@@ -139,7 +139,7 @@ class Gettext extends AbstractFileLoader
}

// Read header entries
- if (array_key_exists('', $textDomain)) {
+ if ($textDomain->offsetExists('')) {
$rawHeaders = explode("\n", trim($textDomain['']));

foreach ($rawHeaders as $rawHeader) {

0 comments on commit 4a564d5

Please sign in to comment.