Browse Source

ZF-11171
Added appropriate missing fclose calls to Zend_Translate_Adapter_Gettext


git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23903 44c647ce-9c0f-0410-b52a-842ac1e357ba

adamlundrigan 14 years ago
parent
commit
1618b4c30e
1 changed files with 4 additions and 0 deletions
  1. 4 0
      library/Zend/Translate/Adapter/Gettext.php

+ 4 - 0
library/Zend/Translate/Adapter/Gettext.php

@@ -72,6 +72,7 @@ class Zend_Translate_Adapter_Gettext extends Zend_Translate_Adapter {
             throw new Zend_Translate_Exception('Error opening translation file \'' . $filename . '\'.');
         }
         if (@filesize($filename) < 10) {
+            @fclose($this->_file);
             require_once 'Zend/Translate/Exception.php';
             throw new Zend_Translate_Exception('\'' . $filename . '\' is not a gettext file');
         }
@@ -83,6 +84,7 @@ class Zend_Translate_Adapter_Gettext extends Zend_Translate_Adapter {
         } else if (strtolower(substr(dechex($input[1]), -8)) == "de120495") {
             $this->_bigEndian = true;
         } else {
+            @fclose($this->_file);
             require_once 'Zend/Translate/Exception.php';
             throw new Zend_Translate_Exception('\'' . $filename . '\' is not a gettext file');
         }
@@ -131,6 +133,8 @@ class Zend_Translate_Adapter_Gettext extends Zend_Translate_Adapter {
                 }
             }
         }
+        
+        @fclose($this->_file);
 
         $this->_data[$locale][''] = trim($this->_data[$locale]['']);
         if (empty($this->_data[$locale][''])) {