summaryrefslogtreecommitdiff
path: root/sapi/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/cli/tests')
-rw-r--r--sapi/cli/tests/bug44564.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/sapi/cli/tests/bug44564.phpt b/sapi/cli/tests/bug44564.phpt
new file mode 100644
index 000000000..7dca62a7e
--- /dev/null
+++ b/sapi/cli/tests/bug44564.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #44564 (escapeshellarg removes UTF-8 multi-byte characters)
+--SKIPIF--
+<?php
+if (false == setlocale(LC_CTYPE, "UTF8", "en_US.UTF-8")) {
+ die("skip setlocale() failed\n");
+}
+?>
+--FILE--
+<?php
+setlocale(LC_CTYPE, "UTF8", "en_US.UTF-8");
+var_dump(escapeshellcmd('f{o}<€>'));
+var_dump(escapeshellarg('f~|;*Þ?'));
+var_dump(escapeshellcmd('?€®đæ?'));
+var_dump(escapeshellarg('aŊł€'));
+
+?>
+--EXPECT--
+string(13) "f\{o\}\<€\>"
+string(10) "'f~|;*Þ?'"
+string(13) "\?€®đæ\?"
+string(10) "'aŊł€'"