php-src/ext/standard/tests/file/open_basedir_cwd_resolve.phpt
Nikita Popov ef59d09af0 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix handling of open_basedir that contains cwd
2021-05-20 09:53:25 +02:00

15 lines
519 B
PHP

--TEST--
CWD on open_basedir should not imply that everything is accessible
--FILE--
<?php
$cwd = getcwd();
ini_set('open_basedir', $cwd);
var_dump(file_get_contents('/some/path/outside/open/basedir'));
?>
--EXPECTF--
Warning: file_get_contents(): open_basedir restriction in effect. File(/some/path/outside/open/basedir) is not within the allowed path(s): (%s) in %s on line %d
Warning: file_get_contents(/some/path/outside/open/basedir): Failed to open stream: Operation not permitted in %s on line %d
bool(false)