- Notifications
You must be signed in to change notification settings - Fork 7.8k
/
Copy pathopen_basedir.phpt
31 lines (29 loc) · 732 Bytes
/
open_basedir.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--TEST--
PDO SQLite open_basedir check
--EXTENSIONS--
pdo_sqlite
--INI--
open_basedir=.
--FILE--
<?php
chdir(__DIR__);
try {
$db = newPDO('sqlite:../not_in_open_basedir.sqlite');
} catch (Exception$e) {
echo$e->getMessage() . "\n";
}
try {
$db = newPDO('sqlite:file:../not_in_open_basedir.sqlite');
} catch (Exception$e) {
echo$e->getMessage() . "\n";
}
try {
$db = newPDO('sqlite:file:../not_in_open_basedir.sqlite?mode=ro');
} catch (Exception$e) {
echo$e->getMessage() . "\n";
}
?>
--EXPECT--
open_basedir prohibits opening ../not_in_open_basedir.sqlite
open_basedir prohibits opening file:../not_in_open_basedir.sqlite
open_basedir prohibits opening file:../not_in_open_basedir.sqlite?mode=ro