1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 12:42:36 +01:00

Add preg_quote

This commit is contained in:
Hillel Coren 2017-11-02 19:25:11 +02:00
parent 62aaa65aa4
commit d5411e3f08

View File

@ -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];
}