Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
Merge pull request #11 from DoubleYo/master
Browse files Browse the repository at this point in the history
add escapeshellarg to shell_exec file path
  • Loading branch information
Anton Nikolaev authored Jun 27, 2018
2 parents ec57b5e + ff211c0 commit 6bce319
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function setOutputDir($dir)
*/
private function setInfoObject()
{
$content = shell_exec($this->getOptions('pdfinfo_path') . ' ' . $this->file);
$content = shell_exec($this->getOptions('pdfinfo_path') . ' ' . escapeshellarg($this->file));
$options = explode("\n", $content);
$info = [];
foreach($options as &$item) {
Expand Down Expand Up @@ -185,7 +185,7 @@ public function getCommand() {
$this->setOptions(['generate'=>['noFrames' => false]]);
$output = $this->getOutputDir() . '/' . preg_replace("/\.pdf$/", '', basename($this->file)) . '.html';
$options = $this->generateOptions();
$command = $this->getOptions('pdftohtml_path') . ' ' . $options . ' ' . $this->file . ' ' . $output;
$command = $this->getOptions('pdftohtml_path') . ' ' . $options . ' ' . escapeshellarg($this->file) . ' ' . escapeshellarg($output);
return $command;
}

Expand Down

0 comments on commit 6bce319

Please sign in to comment.