1--TEST--
2Test open_basedir configuration
3--INI--
4open_basedir=.
5--FILE--
6<?php
7require_once "open_basedir.inc";
8$initdir = getcwd();
9test_open_basedir_before("mkdir");
10
11var_dump(mkdir("../bad/blah"));
12var_dump(mkdir("../blah"));
13var_dump(mkdir("../bad/./blah"));
14var_dump(mkdir("./.././blah"));
15
16var_dump(mkdir($initdir."/test/ok/blah"));
17var_dump(rmdir($initdir."/test/ok/blah"));
18test_open_basedir_after("mkdir");
19?>
20--CLEAN--
21<?php
22require_once "open_basedir.inc";
23delete_directories();
24?>
25--EXPECTF--
26*** Testing open_basedir configuration [mkdir] ***
27bool(true)
28bool(true)
29bool(true)
30bool(true)
31bool(true)
32
33Warning: mkdir(): open_basedir restriction in effect. File(../bad/blah) is not within the allowed path(s): (.) in %s on line %d
34bool(false)
35
36Warning: mkdir(): open_basedir restriction in effect. File(../blah) is not within the allowed path(s): (.) in %s on line %d
37bool(false)
38
39Warning: mkdir(): open_basedir restriction in effect. File(../bad/./blah) is not within the allowed path(s): (.) in %s on line %d
40bool(false)
41
42Warning: mkdir(): open_basedir restriction in effect. File(./.././blah) is not within the allowed path(s): (.) in %s on line %d
43bool(false)
44bool(true)
45bool(true)
46*** Finished testing open_basedir configuration [mkdir] ***
47