cvs: php-src /ext/standard exec.c /sapi/cli/tests bug44564.phpt
| From: | Felipe Pena | Date: | Sun, 30 Mar 2008 12:27:37 +0000 |
| Subject: | cvs: php-src /ext/standard exec.c /sapi/cli/tests bug44564.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-49430@lists.php.net to get a copy of this message | ||
felipe Sun Mar 30 12:27:37 2008 UTC
Modified files:
/php-src/ext/standard exec.c
/php-src/sapi/cli/tests bug44564.phpt
Log:
MFB: Fixed bug #44564 (escapeshellarg removes UTF-8 multi-byte characters)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/exec.c?r1=1.131&r2=1.132&diff_format=u
Index: php-src/ext/standard/exec.c
diff -u php-src/ext/standard/exec.c:1.131 php-src/ext/standard/exec.c:1.132
--- php-src/ext/standard/exec.c:1.131 Sat Mar 22 20:37:08 2008
+++ php-src/ext/standard/exec.c Sun Mar 30 12:27:37 2008
@@ -16,7 +16,7 @@
| Ilia Alshanetsky <iliaa@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: exec.c,v 1.131 2008/03/22 20:37:08 felipe Exp $ */
+/* $Id: exec.c,v 1.132 2008/03/30 12:27:37 felipe Exp $ */
#include <stdio.h>
#include "php.h"
@@ -265,6 +265,8 @@
if (mb_len < 0) {
continue;
} else if (mb_len > 1) {
+ memcpy(cmd + y, str + x, mb_len);
+ y += mb_len;
x += mb_len - 1;
continue;
}
@@ -353,6 +355,8 @@
if (mb_len < 0) {
continue;
} else if (mb_len > 1) {
+ memcpy(cmd + y, str + x, mb_len);
+ y += mb_len;
x += mb_len - 1;
continue;
}
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/tests/bug44564.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/sapi/cli/tests/bug44564.phpt
diff -u /dev/null php-src/sapi/cli/tests/bug44564.phpt:1.2
--- /dev/null Sun Mar 30 12:27:37 2008
+++ php-src/sapi/cli/tests/bug44564.phpt Sun Mar 30 12:27:37 2008
@@ -0,0 +1,16 @@
+--TEST--
+Bug #44564 (escapeshellarg removes UTF-8 multi-byte characters)
+--FILE--
+<?php
+
+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ÅÅâ¬'"