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("is_executable");
10test_open_basedir_error("is_executable");
11
12var_dump(is_executable("ok.txt"));
13var_dump(is_executable("../ok/ok.txt"));
14var_dump(is_executable($initdir."/test/ok/ok.txt"));
15var_dump(is_executable($initdir."/test/ok/../ok/ok.txt"));
16
17test_open_basedir_after("is_executable");
18?>
19--CLEAN--
20<?php
21require_once "open_basedir.inc";
22delete_directories();
23?>
24--EXPECTF--
25*** Testing open_basedir configuration [is_executable] ***
26bool(true)
27bool(true)
28bool(true)
29bool(true)
30bool(true)
31
32Warning: is_executable(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
33bool(false)
34
35Warning: is_executable(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
36bool(false)
37
38Warning: is_executable(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
39bool(false)
40
41Warning: is_executable(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
42bool(false)
43
44Warning: is_executable(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
45bool(false)
46
47Warning: is_executable(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
48bool(false)
49
50Warning: is_executable(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
51bool(false)
52
53Warning: is_executable(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
54bool(false)
55bool(false)
56bool(false)
57bool(false)
58bool(false)
59*** Finished testing open_basedir configuration [is_executable] ***
60