Skip to content
Snippets Groups Projects

Issue #3301239 by @immaculate.x : Check if the file is correctly opened before...

Files

@@ -150,13 +150,14 @@ public function setURI($uri) {
@@ -150,13 +150,14 @@ public function setURI($uri) {
* If the URI is not yet set.
* If the URI is not yet set.
*/
*/
public function open() {
public function open() {
if (!empty($this->uri)) {
if (empty($this->uri)) {
$this->fd = fopen($this->uri, 'rb');
$this->readHeader();
}
else {
throw new \Exception('Cannot open stream without URI set.');
throw new \Exception('Cannot open stream without URI set.');
}
}
 
$this->fd = @fopen($this->uri, 'rb');
 
if (!$this->fd) {
 
throw new \Exception('Cannot open stream for uri ' . $this->uri);
 
}
 
$this->readHeader();
}
}
/**
/**
Loading