From 383b20830b8efa8e98bb0a4ca95192f0b953eaad Mon Sep 17 00:00:00 2001 From: mdekrijger Date: Wed, 28 Nov 2012 21:28:26 +0100 Subject: [PATCH] Dot not escaped in path eval in Sql2Generator.php I found this broken for my node path which was something like /mypath/pages/23948327.3489 Im sure this fixes my problem. But its probably better to check for non-alpha-numeric characters using a regex. If so just escape it, i guess it cant hurt that much. But I leave that for the SQL2 gurus since this is my first real encounter with SQL2 --- src/PHPCR/Util/QOM/Sql2Generator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PHPCR/Util/QOM/Sql2Generator.php b/src/PHPCR/Util/QOM/Sql2Generator.php index 49e1ecdb..13d9b5d4 100644 --- a/src/PHPCR/Util/QOM/Sql2Generator.php +++ b/src/PHPCR/Util/QOM/Sql2Generator.php @@ -325,7 +325,7 @@ public function evalPath($path) $sql2 = $path; // only ensure proper quoting if the user did not quote himself, we trust him to get it right if he did. if (substr($path, 0,1) !== '[' && substr($path, -1) !== ']') { - if (false !== strpos($sql2, ' ')) { + if (false !== strpos($sql2, ' ') || false !== strpos($sql2, '.')) { $sql2 = '"' . $sql2 . '"'; } $sql2 = '[' . $sql2 . ']';