From 4c46a5f5c7130bf89c66b4900fd993422063897b Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 22 Jan 2025 15:09:20 +0100 Subject: [PATCH] modify regex to match optional table alias and ignore column alias equal to column name --- application/core/DB_Model.php | 38 ++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index c3a609f3d..4346b933d 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -991,14 +991,17 @@ class DB_Model extends CI_Model // Find and replace all the occurrences of the provided encrypted columns // with the postgresql decryption function - $query = preg_replace( - '/\b' . $encryptedColumn . '\b/', - sprintf( - self::CRYPT_WHERE_TEMPLATE, - $encryptedColumn, - $decryptionPassword, - $definition[self::CRYPT_CAST] - ), + $query = preg_replace_callback( + '/(?