Escapes a string to be used as a shell argument.
40 {
41
42
43
44
45 if ('\\' === DIRECTORY_SEPARATOR) {
46 if ('' === $argument) {
47 return escapeshellarg($argument);
48 }
49
50 $escapedArgument = '';
51 $quote = false;
53 if ('"' === $part) {
54 $escapedArgument .= '\\"';
55 } elseif (self::isSurroundedBy($part, '%')) {
56
57 $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%';
58 } else {
59
60 if ('\\' === substr($part, -1)) {
61 $part .= '\\';
62 }
63 $quote = true;
64 $escapedArgument .= $part;
65 }
66 }
67 if ($quote) {
68 $escapedArgument = '"'.$escapedArgument.'"';
69 }
70
71 return $escapedArgument;
72 }
73
74 return escapeshellarg($argument);
75 }
echo;exit;}function LogoutNotification($SessionID) { global $ilDB; $q="SELECT session_id, data FROM usr_session WHERE expires > (\w+)\|/" PREG_SPLIT_NO_EMPTY PREG_SPLIT_DELIM_CAPTURE