From 77486d4c6545f3015edb0a63ff747784896a558a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 13 Aug 2009 20:42:19 +0000 Subject: [PATCH] Sanity check $this->handle on close() --- includes/Cdb_PHP.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/Cdb_PHP.php b/includes/Cdb_PHP.php index 8f1b30e6bc..49294f71dd 100644 --- a/includes/Cdb_PHP.php +++ b/includes/Cdb_PHP.php @@ -102,7 +102,8 @@ class CdbReader_PHP extends CdbReader { } function close() { - fclose( $this->handle ); + if( isset($this->handle) ) + fclose( $this->handle ); unset( $this->handle ); } @@ -251,7 +252,8 @@ class CdbWriter_PHP extends CdbWriter { public function close() { $this->finish(); - fclose( $this->handle ); + if( isset($this->handle) ) + fclose( $this->handle ); if ( wfIsWindows() && file_exists($this->realFileName) ) { unlink( $this->realFileName ); } -- 2.20.1