Skip to content

Commit 4e4282a

Browse files
committed
refixed "must not contain any null bytes"
1 parent b8ffe04 commit 4e4282a

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/PhpWord/Element/Image.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ private function setSourceType()
454454
} else {
455455
$this->sourceType = self::SOURCE_GD;
456456
}
457-
} elseif ($this->isFile($this->source)) {
457+
} elseif ((strpos($this->source, chr(0)) === false) && @file_exists($this->source)) {
458458
$this->memoryImage = false;
459459
$this->sourceType = self::SOURCE_LOCAL;
460460
} else {
@@ -463,19 +463,6 @@ private function setSourceType()
463463
}
464464
}
465465

466-
/**
467-
* @param string $filename
468-
* @return bool
469-
*/
470-
private function isFile($filename)
471-
{
472-
try {
473-
return @file_exists($filename);
474-
} catch (\Exception $ex) {
475-
return false;
476-
}
477-
}
478-
479466
/**
480467
* Get image size from archive
481468
*

0 commit comments

Comments
 (0)