mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 21:58:10 +02:00
DibiDataSource: better table name detection in __construct
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user