summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-03-24 12:03:16 +0100
committerThomas Bruederli <thomas@roundcube.net>2013-03-24 12:04:14 +0100
commit73be4b529609d1a53e560891eb9c1d7954b5b1ef (patch)
treeae2c4424b3b0ad5e58bb134189276b9cb60ba40e
parent551ebd46de00742a5c88b229fe72c7112652a626 (diff)
Match regex on multi-line sql statements
-rw-r--r--program/lib/Roundcube/rcube_db.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/program/lib/Roundcube/rcube_db.php b/program/lib/Roundcube/rcube_db.php
index c700ba7bf..631851975 100644
--- a/program/lib/Roundcube/rcube_db.php
+++ b/program/lib/Roundcube/rcube_db.php
@@ -449,7 +449,7 @@ class rcube_db
{
if ($result || ($result === null && ($result = $this->last_result))) {
// repeat query with SELECT COUNT(*) ...
- if (preg_match('/^SELECT\s+(?:ALL\s+|DISTINCT\s+)?(?:.*?)\s+FROM\s+(.*)$/i', $result->queryString, $m)) {
+ if (preg_match('/^SELECT\s+(?:ALL\s+|DISTINCT\s+)?(?:.*?)\s+FROM\s+(.*)$/ims', $result->queryString, $m)) {
$query = $this->dbh->query('SELECT COUNT(*) FROM ' . $m[1], PDO::FETCH_NUM);
return $query ? intval($query->fetchColumn(0)) : false;
}