From 833ced68eb2ba7d76c46673ddcbc29eac0829f7f Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 19 Oct 2021 04:06:31 +0000 Subject: [PATCH] fixed a bug in LoginModel::formatString() --- codepot/src/codepot/models/loginmodel.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codepot/src/codepot/models/loginmodel.php b/codepot/src/codepot/models/loginmodel.php index 1ceab7e7..669f70ef 100644 --- a/codepot/src/codepot/models/loginmodel.php +++ b/codepot/src/codepot/models/loginmodel.php @@ -125,8 +125,8 @@ class LoginModel extends CI_Model function formatString ($fmt, $userid, $password) { - $fmt = preg_replace(sprintf('/\$\{?%s\}?/', 'userid'), $userid, $fmt); - $fmt = preg_replace(sprintf('/\$\{?%s\}?/', 'password'), $password, $fmt); - return $fmt; + $regexs = array('${userid}', '${password}'); + $repl = array($userid, $password); + return str_replace($regexs, $repl, $fmt); } }