From 14de18d5f4636ca86ed8cac4c8c725e07bd2ff79 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sun, 16 Nov 2008 03:53:10 -0500
Subject: [PATCH] - Fix setting locale to tr_TR, ku and az_AZ (#1485470)

---
 program/lib/MDB2.php |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/program/lib/MDB2.php b/program/lib/MDB2.php
index 7765541..7b769ff 100644
--- a/program/lib/MDB2.php
+++ b/program/lib/MDB2.php
@@ -2915,9 +2915,7 @@
         $colon = ':';
         $positions = array();
         $position = 0;
-        $ignores = $this->string_quoting;
-        $ignores[] = $this->identifier_quoting;
-        $ignores[] = $this->sql_comments;
+	
         while ($position < strlen($query)) {
             $q_position = strpos($query, $question, $position);
             $c_position = strpos($query, $colon, $position);
@@ -3008,9 +3006,9 @@
      */
     function _skipDelimitedStrings($query, $position, $p_position)
     {
-        $ignores = $this->string_quoting;
-        $ignores[] = $this->identifier_quoting;
-        $ignores[] = $this->sql_comments;
+	$ignores[] = $this->string_quoting;
+	$ignores[] = $this->identifier_quoting;
	
+        $ignores = array_merge($ignores, $this->sql_comments);
         
         foreach ($ignores as $ignore) {
             if (!empty($ignore['start'])) {
@@ -3026,7 +3024,11 @@
                                 return $err;
                             }
                         }
-                    } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape'] && $end_quote-1 != $start_quote);
+                    } while ($ignore['escape']
+			    && $end_quote-1 != $start_quote
+			    && $query[($end_quote - 1)] == $ignore['escape']
+			    && ($ignore['escape_pattern'] !== $ignore['escape']
+				    || $query[($end_quote - 2)] != $ignore['escape']));
                     $position = $end_quote + 1;
                     return $position;
                 }

--
Gitblit v1.9.1