From dc5d6da43e704a5429dbebe0d12493d13c73dbca Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Mon, 8 Mar 2021 10:36:25 +0000 Subject: [PATCH] Don't add domain if already exists. The actuall code checking if a domain has already be added using `add_domain` doesn't work. This can cause memory exhaunstion when sending emails in mass. --- includes/lang/gettext.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/lang/gettext.inc b/includes/lang/gettext.inc index 9f1a83817..3473cdf8d 100644 --- a/includes/lang/gettext.inc +++ b/includes/lang/gettext.inc @@ -297,7 +297,8 @@ class gettext_php_support extends gettext_native_support $domain .= '-'.$version; } - if (array_key_exists($domain, $this->_domains)) + $domains = array_map(function($d) {return $d->name;}, $this->_domains); + if (in_array($domain, $domains)) { return; }