From 30de055a35a08002810bdc025e1388b566ae0aeb Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 14 Mar 2016 18:06:16 +0100 Subject: [PATCH] Replace str_replace with strtr --- wcfsetup/install/files/lib/data/notice/Notice.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/data/notice/Notice.class.php b/wcfsetup/install/files/lib/data/notice/Notice.class.php index a950eabff2..5e54388938 100644 --- a/wcfsetup/install/files/lib/data/notice/Notice.class.php +++ b/wcfsetup/install/files/lib/data/notice/Notice.class.php @@ -41,8 +41,12 @@ class Notice extends DatabaseObject implements IRouteController { * @since 2.2 */ public function __toString() { - // replace `{$username}` with the active user's name and the `{$email}` with the active users' email address - $text = str_replace(['{$username}', '{$email}'], [WCF::getUser()->username, WCF::getUser()->email], WCF::getLanguage()->get($this->notice)); + // replace `{$username}` with the active user's name and `{$email}` + // with the active user's email address + $text = strtr(WCF::getLanguage()->get($this->notice), [ + '{$username}' => WCF::getUser()->username, + '{$email}' => WCF::getUser()->email + ]); if (!$this->noticeUseHtml) { $text = nl2br(htmlspecialchars($text)); -- 2.20.1