Skip to content

Commit 76919c8

Browse files
Fixing stupid empty() issue that occurs with versions of PHP older than 5.5
1 parent eb21c63 commit 76919c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/OpenCloud/ObjectStore/Resource/DataObject.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ public function create($params = array(), $filename = null, $extractArchive = nu
291291
$this->content_length = $filesize;
292292

293293
// Guess the content type if necessary
294-
if (empty($this->getContentType()) && $this->isRealFile($filename)) {
294+
if (!$this->getContentType() && $this->isRealFile($filename)) {
295295
$this->setContentType($this->inferContentType($filename));
296296
}
297297

@@ -340,7 +340,7 @@ public function create($params = array(), $filename = null, $extractArchive = nu
340340

341341
// Content-Type is no longer required; if not specified, it will
342342
// attempt to guess based on the file extension.
343-
if (!empty($this->getContentType())) {
343+
if (!$this->getContentType()) {
344344
$headers['Content-Type'] = $this->getContentType();
345345
}
346346

0 commit comments

Comments
 (0)