Skip to content

Commit 25941f2

Browse files
committed
Merge pull request #41 from bonzai/fix/escape-arguments
Escape shell arguments
2 parents 4604eb0 + a435bb7 commit 25941f2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/PHPExif/Adapter/Exiftool.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,13 @@ public function getToolPath()
100100
*/
101101
public function getExifFromFile($file)
102102
{
103-
$gpsFormat = '%d deg %d\' %.4f\"';
104-
105103
$result = $this->getCliOutput(
106104
sprintf(
107-
'%1$s%3$s -j -c "%4$s" %2$s',
105+
'%1$s%3$s -j -c %4$s %2$s',
108106
$this->getToolPath(),
109-
$file,
107+
escapeshellarg($file),
110108
$this->numeric ? ' -n' : '',
111-
$gpsFormat
109+
escapeshellarg('%d deg %d\' %.4f"')
112110
)
113111
);
114112

0 commit comments

Comments
 (0)