iliaa Sun Dec 9 16:37:02 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src NEWS
/php-src/ext/standard exec.c
Log:
Fixed bug #43533 (escapeshellarg('') returns null).
# Backport of code from 5.3
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1029&r2=1.2027.2.547.2.1030&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1029 php-src/NEWS:1.2027.2.547.2.1030
--- php-src/NEWS:1.2027.2.547.2.1029 Wed Dec 5 20:04:13 2007
+++ php-src/NEWS Sun Dec 9 16:37:01 2007
@@ -3,6 +3,7 @@
?? ??? 2008, PHP 5.2.6
- Fixed weired behavior in CGI parameter parsing. (Dmitry, Hannes Magnusson)
+- Fixed bug #43533 (escapeshellarg('') returns null). (Ilia)
- Fixed bug #43495 (array_merge_recursive() crashes with recursive arrays).
(Ilia)
- Fixed bug #43493 (pdo_pgsql does not send username on connect when password
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/exec.c?r1=1.113.2.3.2.2&r2=1.113.2.3.2.3&diff_format=u
Index: php-src/ext/standard/exec.c
diff -u php-src/ext/standard/exec.c:1.113.2.3.2.2
php-src/ext/standard/exec.c:1.113.2.3.2.3
--- php-src/ext/standard/exec.c:1.113.2.3.2.2 Thu Oct 4 13:31:11 2007
+++ php-src/ext/standard/exec.c Sun Dec 9 16:37:02 2007
@@ -16,7 +16,7 @@
| Ilia Alshanetsky <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: exec.c,v 1.113.2.3.2.2 2007/10/04 13:31:11 jani Exp $ */
+/* $Id: exec.c,v 1.113.2.3.2.3 2007/12/09 16:37:02 iliaa Exp $ */
#include <stdio.h>
#include "php.h"
@@ -392,18 +392,17 @@
Quote and escape an argument for use in a shell command */
PHP_FUNCTION(escapeshellarg)
{
- zval **arg1;
+ char *argument;
+ int argument_len;
char *cmd = NULL;
- if (zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &argument,
&argument_len) == FAILURE) {
+ return;
}
-
- convert_to_string_ex(arg1);
- if (Z_STRLEN_PP(arg1)) {
- cmd = php_escape_shell_arg(Z_STRVAL_PP(arg1));
- RETVAL_STRING(cmd, 1);
- efree(cmd);
+
+ if (argument) {
+ cmd = php_escape_shell_arg(argument);
+ RETVAL_STRING(cmd, 0);
}
}
/* }}} */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php