From 576397319aec0ed4462a206708ebc0e56c6e0bf5 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 16 Feb 2010 19:19:32 +0100 Subject: [PATCH] DibiDataSource: better table name detection in __construct --- dibi/libs/DibiDataSource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dibi/libs/DibiDataSource.php b/dibi/libs/DibiDataSource.php index aed7c33d..f4193782 100644 --- a/dibi/libs/DibiDataSource.php +++ b/dibi/libs/DibiDataSource.php @@ -58,7 +58,7 @@ class DibiDataSource extends DibiObject implements IDataSource */ public function __construct($sql, DibiConnection $connection) { - if (strpos($sql, ' ') === FALSE) { + if (strpbrk($sql, " \t\r\n") === FALSE) { $this->sql = $connection->getDriver()->escape($sql, dibi::IDENTIFIER); // table name } else { $this->sql = '(' . $sql . ') t'; // SQL command