summaryrefslogtreecommitdiff
path: root/sapi/cli
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/cli')
-rw-r--r--sapi/cli/getopt.c4
-rw-r--r--sapi/cli/php.1.in4
-rw-r--r--sapi/cli/php_cli.c16
-rw-r--r--sapi/cli/php_cli_readline.c4
-rw-r--r--sapi/cli/php_cli_readline.h4
-rw-r--r--sapi/cli/php_getopt.h4
-rw-r--r--sapi/cli/tests/bug44564.phpt22
7 files changed, 40 insertions, 18 deletions
diff --git a/sapi/cli/getopt.c b/sapi/cli/getopt.c
index 450de55af..5b0bc5448 100644
--- a/sapi/cli/getopt.c
+++ b/sapi/cli/getopt.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2007 The PHP Group |
+ | Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: getopt.c,v 1.8.2.1.2.6 2007/06/04 09:47:54 tony2001 Exp $ */
+/* $Id: getopt.c,v 1.8.2.1.2.7 2007/12/31 07:20:16 sebastian Exp $ */
#include <stdio.h>
#include <string.h>
diff --git a/sapi/cli/php.1.in b/sapi/cli/php.1.in
index cb31c832c..9e78fef11 100644
--- a/sapi/cli/php.1.in
+++ b/sapi/cli/php.1.in
@@ -1,4 +1,4 @@
-.TH PHP 1 "2007" "The PHP Group" "Scripting Language"
+.TH PHP 1 "2008" "The PHP Group" "Scripting Language"
.SH NAME
.TP 15
php \- PHP Command Line Interface 'CLI'
@@ -400,7 +400,7 @@ contributors all around the world.
.SH VERSION INFORMATION
This manpage describes \fBphp\fP, version @PHP_VERSION@.
.SH COPYRIGHT
-Copyright \(co 1997\-2007 The PHP Group
+Copyright \(co 1997\-2008 The PHP Group
.LP
This source file is subject to version 3.01 of the PHP license,
that is bundled with this package in the file LICENSE, and is
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index c441835f1..fa3d582bc 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2007 The PHP Group |
+ | Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_cli.c,v 1.129.2.13.2.22 2007/08/08 23:51:24 stas Exp $ */
+/* $Id: php_cli.c,v 1.129.2.13.2.24 2008/01/29 20:01:14 dmitry Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -588,7 +588,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
int main(int argc, char *argv[])
#endif
{
- int exit_status = SUCCESS;
+ volatile int exit_status = SUCCESS;
int c;
zend_file_handle file_handle;
/* temporary locals */
@@ -599,8 +599,8 @@ int main(int argc, char *argv[])
char *arg_free=NULL, **arg_excp=&arg_free;
char *script_file=NULL;
int interactive=0;
- int module_started = 0;
- int request_started = 0;
+ volatile int module_started = 0;
+ volatile int request_started = 0;
int lineno = 0;
char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL;
const char *param_error=NULL;
@@ -779,7 +779,7 @@ int main(int argc, char *argv[])
}
request_started = 1;
- php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2007 The PHP Group\n%s",
+ php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2008 The PHP Group\n%s",
PHP_VERSION, sapi_module.name, __DATE__, __TIME__,
#if ZEND_DEBUG && defined(HAVE_GCOV)
"(DEBUG GCOV)",
@@ -1229,8 +1229,9 @@ int main(int argc, char *argv[])
if (exec_end && zend_eval_string_ex(exec_end, NULL, "Command line end code", 1 TSRMLS_CC) == FAILURE) {
exit_status=254;
}
-
+
break;
+ }
#ifdef HAVE_REFLECTION
case PHP_MODE_REFLECTION_FUNCTION:
case PHP_MODE_REFLECTION_CLASS:
@@ -1311,7 +1312,6 @@ int main(int argc, char *argv[])
zend_printf("Additional .ini files parsed: %s\n", php_ini_scanned_files ? php_ini_scanned_files : "(none)");
break;
}
- }
}
} zend_end_try();
diff --git a/sapi/cli/php_cli_readline.c b/sapi/cli/php_cli_readline.c
index c0f5d1a1a..614ee26f3 100644
--- a/sapi/cli/php_cli_readline.c
+++ b/sapi/cli/php_cli_readline.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2007 The PHP Group |
+ | Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_cli_readline.c,v 1.3.2.5.2.3 2007/06/04 09:47:54 tony2001 Exp $ */
+/* $Id: php_cli_readline.c,v 1.3.2.5.2.4 2007/12/31 07:20:16 sebastian Exp $ */
#include "php.h"
diff --git a/sapi/cli/php_cli_readline.h b/sapi/cli/php_cli_readline.h
index f27525faa..b5e489aed 100644
--- a/sapi/cli/php_cli_readline.h
+++ b/sapi/cli/php_cli_readline.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2007 The PHP Group |
+ | Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_cli_readline.h,v 1.2.2.1.2.1 2007/01/01 09:36:12 sebastian Exp $ */
+/* $Id: php_cli_readline.h,v 1.2.2.1.2.2 2007/12/31 07:20:16 sebastian Exp $ */
#include "php.h"
diff --git a/sapi/cli/php_getopt.h b/sapi/cli/php_getopt.h
index 24ac5c3f3..0c8e06829 100644
--- a/sapi/cli/php_getopt.h
+++ b/sapi/cli/php_getopt.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2007 The PHP Group |
+ | Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_getopt.h,v 1.7.2.1.2.1 2007/01/01 09:36:12 sebastian Exp $ */
+/* $Id: php_getopt.h,v 1.7.2.1.2.2 2007/12/31 07:20:16 sebastian Exp $ */
#include "php.h"
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Ŋł€'"