use regex with word boundaries to be more specific when replacing

This commit is contained in:
Harald Bamberger
2024-12-03 13:44:24 +01:00
parent e63234e7bc
commit 6f69046b71
+4 -4
View File
@@ -991,8 +991,8 @@ class DB_Model extends CI_Model
// Find and replace all the occurrences of the provided encrypted columns
// with the postgresql decryption function
$query = str_replace(
$encryptedColumn,
$query = preg_replace(
'/\b' . $encryptedColumn . '\b/',
sprintf(
self::CRYPT_WHERE_TEMPLATE,
$encryptedColumn,
@@ -1106,8 +1106,8 @@ class DB_Model extends CI_Model
{
// Find and replace all the occurrences of the provided encrypted columns
// with the postgresql decryption function
$where = str_replace(
$encryptedColumn,
$where = preg_replace(
'/\b' . $encryptedColumn . '\b/',
sprintf(
self::CRYPT_WHERE_TEMPLATE,
$encryptedColumn,