From 2a3251a82919a40faaafb908c03bade4d3517fb4 Mon Sep 17 00:00:00 2001 From: catch Date: Sat, 12 May 2012 12:15:33 +0900 Subject: [PATCH] Issue #1565972 by c960657: Clean-up of mapConditionOperator(). --- .../Core/Database/Driver/pgsql/Connection.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php index 129ca42fec0..a8bdaa917a5 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php @@ -157,18 +157,12 @@ class Connection extends DatabaseConnection { } public function mapConditionOperator($operator) { - static $specials; - - // Function calls not allowed in static declarations, thus this method. - if (!isset($specials)) { - $specials = array( - // In PostgreSQL, 'LIKE' is case-sensitive. For case-insensitive LIKE - // statements, we need to use ILIKE instead. - 'LIKE' => array('operator' => 'ILIKE'), - 'NOT LIKE' => array('operator' => 'NOT ILIKE'), - ); - } - + static $specials = array( + // In PostgreSQL, 'LIKE' is case-sensitive. For case-insensitive LIKE + // statements, we need to use ILIKE instead. + 'LIKE' => array('operator' => 'ILIKE'), + 'NOT LIKE' => array('operator' => 'NOT ILIKE'), + ); return isset($specials[$operator]) ? $specials[$operator] : NULL; }