Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4.125 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
44 | 4 | public static function escapeShellArgument(string $argument): string |
|
45 | { |
||
46 | 4 | $isUTF8Filesystem = !empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']); |
|
47 | 4 | if ($isUTF8Filesystem) { |
|
48 | $currentLocale = setlocale(LC_CTYPE, 0); |
||
49 | setlocale( |
||
50 | LC_CTYPE, |
||
51 | $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale'] |
||
52 | ); |
||
53 | } |
||
54 | |||
55 | 4 | $argument = escapeshellarg($argument); |
|
56 | |||
57 | 4 | if ($isUTF8Filesystem) { |
|
58 | setlocale(LC_CTYPE, $currentLocale); |
||
|
|||
59 | } |
||
60 | |||
61 | 4 | return $argument; |
|
62 | } |
||
64 |