From: Matthias Schmidt Date: Mon, 14 Mar 2016 17:06:16 +0000 (+0100) Subject: Replace str_replace with strtr X-Git-Tag: 3.0.0_Beta_1~2033 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=30de055a35a08002810bdc025e1388b566ae0aeb;p=GitHub%2FWoltLab%2FWCF.git Replace str_replace with strtr --- 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));