From d5411e3f08c9df65dabbfe6d9aa8b5600be2d1b2 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 2 Nov 2017 19:25:11 +0200 Subject: [PATCH] Add preg_quote --- app/Libraries/Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index 3e43eab32d..58e1eb1333 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -1064,7 +1064,7 @@ class Utils { $name = trim($name); $lastName = (strpos($name, ' ') === false) ? '' : preg_replace('#.*\s([\w-]*)$#', '$1', $name); - $firstName = trim(preg_replace('#'.$lastName.'#', '', $name)); + $firstName = trim(preg_replace('#' . preg_quote($lastName, '/') . '#', '', $name)); return [$firstName, $lastName]; }