Skip to content

Commit

Permalink
Merge pull request #713 from samsonasik/baseconnection-connid
Browse files Browse the repository at this point in the history
Fixes BaseConnection::connID false value which previously interpreted as null ( is_null )
  • Loading branch information
lonnieezell authored Sep 9, 2017
2 parents 61cf692 + fabc8c4 commit 6b6bede
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion system/Database/MySQLi/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ protected function _escapeString(string $str): string
return $str;
}

if (is_null($this->connID))
if (! $this->connID)
{
$this->initialize();
}
Expand Down
7 changes: 6 additions & 1 deletion system/Database/Postgre/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ public function affectedRows(): int
*/
public function escape($str)
{
if (! $this->connID)
{
$this->initialize();
}

if (is_string($str) OR ( is_object($str) && method_exists($str, '__toString')))
{
return pg_escape_literal($this->connID, $str);
Expand All @@ -234,7 +239,7 @@ public function escape($str)
*/
protected function _escapeString(string $str): string
{
if (is_null($this->connID))
if (! $this->connID)
{
$this->initialize();
}
Expand Down

0 comments on commit 6b6bede

Please sign in to comment.