From 9c705b72b8a2f9297d8fa7f3d967e320cfe5bb45 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Sat, 06 Dec 2008 13:03:57 -0500
Subject: [PATCH] Fix position of the filter box

---
 program/lib/MDB2.php |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/program/lib/MDB2.php b/program/lib/MDB2.php
index 326152f..7b769ff 100644
--- a/program/lib/MDB2.php
+++ b/program/lib/MDB2.php
@@ -2915,9 +2915,7 @@
         $colon = ':';
         $positions = array();
         $position = 0;
-        $ignores = $this->sql_comments;
-        $ignores[] = $this->string_quoting;
-        $ignores[] = $this->identifier_quoting;
+	
         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->sql_comments;
-        $ignores[] = $this->string_quoting;
-        $ignores[] = $this->identifier_quoting;
+	$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;
                 }
@@ -3148,7 +3150,7 @@
     function getSequenceName($sqn)
     {
         return sprintf($this->options['seqname_format'],
-            preg_replace('/[^a-z0-9_\$.]/i', '_', $sqn));
+            preg_replace('/[^a-z0-9_\-\$.]/i', '_', $sqn));
     }
 
     // }}}

--
Gitblit v1.9.1