From 6666d71e5b21450daadba3b90fbdee0f217a72d8 Mon Sep 17 00:00:00 2001 From: Ondrej Brablc Date: Thu, 20 Feb 2014 18:47:35 +0100 Subject: [PATCH] Avoid error handler invocation --- dibi/dibi.php | 5 +++-- dibi/drivers/DibiMySqliDriver.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dibi/dibi.php b/dibi/dibi.php index 7f52678..cdeacaf 100644 --- a/dibi/dibi.php +++ b/dibi/dibi.php @@ -14,8 +14,9 @@ if (version_compare(PHP_VERSION, '5.2.0', '<')) { throw new Exception('dibi needs PHP 5.2.0 or newer.'); } -@set_magic_quotes_runtime(FALSE); // intentionally @ - +if (get_magic_quotes_runtime()) { + set_magic_quotes_runtime(FALSE); +} require_once dirname(__FILE__) . '/libs/interfaces.php'; require_once dirname(__FILE__) . '/libs/DibiDateTime.php'; diff --git a/dibi/drivers/DibiMySqliDriver.php b/dibi/drivers/DibiMySqliDriver.php index 3ab336f..071693a 100644 --- a/dibi/drivers/DibiMySqliDriver.php +++ b/dibi/drivers/DibiMySqliDriver.php @@ -458,7 +458,7 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver, IDibiResultDri public function getResultResource() { $this->autoFree = FALSE; - return @$this->resultSet->type === NULL ? NULL : $this->resultSet; + return $this->resultSet === NULL || $this->resultSet->type === NULL ? NULL : $this->resultSet; } }