diff --git a/application/config/db_crypt.php b/application/config/db_crypt.php index e3329a158..72f8c30d8 100644 --- a/application/config/db_crypt.php +++ b/application/config/db_crypt.php @@ -20,5 +20,10 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); // NOTE: if database encryption is _not_ used then leave this array empty! -$config['encryption_passwords'] = array(); +$config['encryption_passwords'] = array( + // 'password name 1' => 'password 1' + // 'password name 2' => 'password 2' + // 'password name ...' => 'password ...' + // 'password name N' => 'password N' +); diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index 69e088ef8..062bc06c2 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -923,7 +923,7 @@ class DB_Model extends CI_Model $value, $encryptionPassword ), - false + false // no escaping ); } else // otherwise copy this element as it is @@ -1035,12 +1035,18 @@ class DB_Model extends CI_Model { $operator = null; // operator not found in the column name - // Custom operators - if (strpos($column, '>') != false - || strpos($column, '<') != false - || strpos($column, '>=') != false + // Custom operators with 2 chars + if (strpos($column, '>=') != false || strpos($column, '<=') != false || strpos($column, '!=') != false + || strpos($column, '<>') != false + ) + { + $operator = ' '.substr(trim($column), -2).' '; + } + // Custom operators with 1 chars + elseif (strpos($column, '>') != false + || strpos($column, '<') != false || strpos($column, '=') != false ) {