dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6669415
)
Use wfShellExec in MimeMagic
author
umherirrender
<umherirrender_de.wp@web.de>
Sun, 21 Apr 2013 14:59:18 +0000
(16:59 +0200)
committer
Gerrit Code Review
<gerrit@wikimedia.org>
Thu, 25 Apr 2013 19:25:18 +0000
(19:25 +0000)
This avoids shell execution with backticks
Change-Id: I37ca19f4b19a3a7f2834a234051e4044653fcfb1
includes/MimeMagic.php
patch
|
blob
|
history
diff --git
a/includes/MimeMagic.php
b/includes/MimeMagic.php
index
24d803b
..
1627b3d
100644
(file)
--- a/
includes/MimeMagic.php
+++ b/
includes/MimeMagic.php
@@
-876,9
+876,8
@@
class MimeMagic {
$m = null;
if ( $wgMimeDetectorCommand ) {
- // @todo FIXME: Use wfShellExec
- $fn = wfEscapeShellArg( $file );
- $m = `$wgMimeDetectorCommand $fn`;
+ $args = wfEscapeShellArg( $file );
+ $m = wfShellExec( "$wgMimeDetectorCommand $args" );
} elseif ( function_exists( "finfo_open" ) && function_exists( "finfo_file" ) ) {
# This required the fileinfo extension by PECL,