Skip to content

Commit

Permalink
Use PHP build-in function escapeshellarg for filepath
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschmidt95 committed Dec 8, 2024
1 parent 654af64 commit 88bdcc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ phpunit.xml
.phpunit.cache

ImageMagick*.tar.gz
/ImageMagick-*/

.idea
/ImageMagick-*/
3 changes: 1 addition & 2 deletions src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ private static function cleanPath(string $path, bool $rtrim = false): string
$path = \rtrim($path, '/');
}

$path = \trim($path, '"');
$path = '"' . $path . '"';
$path = \escapeshellarg($path);

return $path;
}
Expand Down

0 comments on commit 88bdcc1

Please sign in to comment.