--- embedaddon/php/ext/standard/ftok.c 2012/02/21 23:48:02 1.1.1.1 +++ embedaddon/php/ext/standard/ftok.c 2012/05/29 12:34:43 1.1.1.2 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ftok.c,v 1.1.1.1 2012/02/21 23:48:02 misho Exp $ */ +/* $Id: ftok.c,v 1.1.1.2 2012/05/29 12:34:43 misho Exp $ */ #include "php.h" @@ -35,14 +35,10 @@ PHP_FUNCTION(ftok) int pathname_len, proj_len; key_t k; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) { return; } - if (strlen(pathname) != pathname_len) { - RETURN_FALSE; - } - if (pathname_len == 0){ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pathname is invalid"); RETURN_LONG(-1); @@ -51,9 +47,9 @@ PHP_FUNCTION(ftok) if (proj_len != 1){ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Project identifier is invalid"); RETURN_LONG(-1); - } + } - if ((PG(safe_mode) && (!php_checkuid(pathname, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pathname TSRMLS_CC)) { + if (php_check_open_basedir(pathname TSRMLS_CC)) { RETURN_LONG(-1); }