comparison vendor/symfony/process/ProcessUtils.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
44 44
45 //Fix for PHP bug #43784 escapeshellarg removes % from given string 45 //Fix for PHP bug #43784 escapeshellarg removes % from given string
46 //Fix for PHP bug #49446 escapeshellarg doesn't work on Windows 46 //Fix for PHP bug #49446 escapeshellarg doesn't work on Windows
47 //@see https://bugs.php.net/bug.php?id=43784 47 //@see https://bugs.php.net/bug.php?id=43784
48 //@see https://bugs.php.net/bug.php?id=49446 48 //@see https://bugs.php.net/bug.php?id=49446
49 if ('\\' === DIRECTORY_SEPARATOR) { 49 if ('\\' === \DIRECTORY_SEPARATOR) {
50 if ('' === $argument) { 50 if ('' === $argument) {
51 return escapeshellarg($argument); 51 return escapeshellarg($argument);
52 } 52 }
53 53
54 $escapedArgument = ''; 54 $escapedArgument = '';
89 * @throws InvalidArgumentException In case the input is not valid 89 * @throws InvalidArgumentException In case the input is not valid
90 */ 90 */
91 public static function validateInput($caller, $input) 91 public static function validateInput($caller, $input)
92 { 92 {
93 if (null !== $input) { 93 if (null !== $input) {
94 if (is_resource($input)) { 94 if (\is_resource($input)) {
95 return $input; 95 return $input;
96 } 96 }
97 if (is_string($input)) { 97 if (\is_string($input)) {
98 return $input; 98 return $input;
99 } 99 }
100 if (is_scalar($input)) { 100 if (is_scalar($input)) {
101 return (string) $input; 101 return (string) $input;
102 } 102 }
116 return $input; 116 return $input;
117 } 117 }
118 118
119 private static function isSurroundedBy($arg, $char) 119 private static function isSurroundedBy($arg, $char)
120 { 120 {
121 return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; 121 return 2 < \strlen($arg) && $char === $arg[0] && $char === $arg[\strlen($arg) - 1];
122 } 122 }
123 } 123 }