aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/driver/sqlite3.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-06-22 18:08:38 +0200
committerTristan Darricau <github@nicofuma.fr>2014-06-22 18:16:21 +0200
commit2276c1c0f246a39dee8d0e979c89e8de0ee7a5de (patch)
tree2fa3ad4b6eaab11defa6ce3accc9ef95bca71bbb /phpBB/phpbb/db/driver/sqlite3.php
parentafe9d3c3f39ca1c69146778882f2b0250dfa3ed7 (diff)
downloadforums-2276c1c0f246a39dee8d0e979c89e8de0ee7a5de.tar
forums-2276c1c0f246a39dee8d0e979c89e8de0ee7a5de.tar.gz
forums-2276c1c0f246a39dee8d0e979c89e8de0ee7a5de.tar.bz2
forums-2276c1c0f246a39dee8d0e979c89e8de0ee7a5de.tar.xz
forums-2276c1c0f246a39dee8d0e979c89e8de0ee7a5de.zip
[ticket/12387] Cleanup *_free_result call and remove @ on that call
PHPBB3-12387
Diffstat (limited to 'phpBB/phpbb/db/driver/sqlite3.php')
-rw-r--r--phpBB/phpbb/db/driver/sqlite3.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php
index 2c6bf99497..4ca3d8f91d 100644
--- a/phpBB/phpbb/db/driver/sqlite3.php
+++ b/phpBB/phpbb/db/driver/sqlite3.php
@@ -50,7 +50,7 @@ class sqlite3 extends \phpbb\db\driver\driver
$this->dbo = new \SQLite3($this->server, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);
$this->db_connect_id = true;
}
- catch (Exception $e)
+ catch (\Exception $e)
{
return array('message' => $e->getMessage());
}
@@ -138,6 +138,11 @@ class sqlite3 extends \phpbb\db\driver\driver
$this->sql_report('stop', $query);
}
+ if (!$this->query_result)
+ {
+ return false;
+ }
+
if ($cache && $cache_ttl)
{
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
@@ -362,9 +367,12 @@ class sqlite3 extends \phpbb\db\driver\driver
$endtime = $endtime[0] + $endtime[1];
$result = $this->dbo->query($query);
- while ($void = $result->fetchArray(SQLITE3_ASSOC))
+ if ($result)
{
- // Take the time spent on parsing rows into account
+ while ($void = $result->fetchArray(SQLITE3_ASSOC))
+ {
+ // Take the time spent on parsing rows into account
+ }
}
$splittime = explode(' ', microtime());