version 1.1.1.1, 2012/02/21 23:48:02
|
version 1.1.1.2, 2012/05/29 12:34:43
|
Line 35 PHP_FUNCTION(ftok)
|
Line 35 PHP_FUNCTION(ftok)
|
int pathname_len, proj_len; |
int pathname_len, proj_len; |
key_t k; |
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; |
return; |
} |
} |
|
|
if (strlen(pathname) != pathname_len) { |
|
RETURN_FALSE; |
|
} |
|
|
|
if (pathname_len == 0){ |
if (pathname_len == 0){ |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pathname is invalid"); |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pathname is invalid"); |
RETURN_LONG(-1); |
RETURN_LONG(-1); |
Line 51 PHP_FUNCTION(ftok)
|
Line 47 PHP_FUNCTION(ftok)
|
if (proj_len != 1){ |
if (proj_len != 1){ |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Project identifier is invalid"); |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Project identifier is invalid"); |
RETURN_LONG(-1); |
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); |
RETURN_LONG(-1); |
} |
} |
|
|