diff options
Diffstat (limited to 'paste')
-rw-r--r-- | paste/include/storage/MysqlStorage.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/paste/include/storage/MysqlStorage.php b/paste/include/storage/MysqlStorage.php index 4c713bc..bae4855 100644 --- a/paste/include/storage/MysqlStorage.php +++ b/paste/include/storage/MysqlStorage.php @@ -71,8 +71,11 @@ INDEX (nick) function __destruct() { - if (is_instance_of($this->mysql, 'mysqli')) - $this->mysql->close(); + if (is_null($this->mysql)) + return; + + $this->mysql->close(); + $this->mysql = null; } public function setContent($content, $language, $nick, $description) @@ -119,9 +122,9 @@ INDEX (nick) die('No such paste'); } - echo PastifyText($content, $lang, $description); - $shmt->close(); + + echo PastifyText($content, $lang, $description); } } } |