Skip to content

Commit 88bdcc1

Browse files
Use PHP build-in function escapeshellarg for filepath
1 parent 654af64 commit 88bdcc1

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,4 @@ phpunit.xml
1111
.phpunit.cache
1212

1313
ImageMagick*.tar.gz
14-
/ImageMagick-*/
15-
16-
.idea
14+
/ImageMagick-*/

src/Command.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ private static function cleanPath(string $path, bool $rtrim = false): string
126126
$path = \rtrim($path, '/');
127127
}
128128

129-
$path = \trim($path, '"');
130-
$path = '"' . $path . '"';
129+
$path = \escapeshellarg($path);
131130

132131
return $path;
133132
}

0 commit comments

Comments
 (0)