mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
Another safe-mode fix. parse_ini_file() did not check
@ safe-mode fix for parse_ini_file() (Rasmus)
This commit is contained in:
parent
9cbcc9b822
commit
465b2d54db
@ -2471,6 +2471,15 @@ PHP_FUNCTION(parse_ini_file)
|
||||
}
|
||||
|
||||
convert_to_string_ex(filename);
|
||||
|
||||
if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(filename), NULL, CHECKUID_ALLOW_ONLY_FILE))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (php_check_open_basedir(Z_STRVAL_PP(filename) TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
fh.handle.fp = VCWD_FOPEN(Z_STRVAL_PP(filename), "r");
|
||||
if (!fh.handle.fp) {
|
||||
php_error(E_WARNING, "Cannot open '%s' for reading", Z_STRVAL_PP(filename));
|
||||
|
Loading…
Reference in New Issue
Block a user