From 59614b05c4add2e1888c83870b93fe0e257c09f6 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Wed, 7 Sep 2011 12:33:22 +0000 Subject: - reject paths with trainling spaces using the very good new zend arg --- Zend/zend_API.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Zend/zend_API.c') diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 5401483db7..c83b3d0f0e 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -438,6 +438,14 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, const cha if (c == 'p' && CHECK_ZVAL_NULL_PATH(*arg)) { return "a valid path"; } +#ifdef PHP_WIN32 + if (c == 'p') { + /* do not allow trailing space (or single, */ + if (Z_STRVAL_PP(arg)[0] == ' ' || Z_STRVAL_PP(arg)[Z_STRLEN_PP(arg) - 1] == ' ') { + return "a valid path"; + } + } +#endif break; case IS_OBJECT: -- cgit v1.2.1