From 6f69046b71cc6392a8882e7147bd9a55430ea19c Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 3 Dec 2024 13:44:24 +0100 Subject: [PATCH] use regex with word boundaries to be more specific when replacing --- application/core/DB_Model.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index 36de01a4a..c3a609f3d 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -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,