File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ PDO SQLite open_basedir check
3
+ --SKIPIF--
4
+ <?php if (!extension_loaded ('pdo_sqlite ' )) print 'skip not loaded ' ; ?>
5
+ --INI--
6
+ open_basedir=.
7
+ --FILE--
8
+ <?php
9
+ chdir (__DIR__ );
10
+
11
+ try {
12
+ $ db = new PDO ('sqlite:../not_in_open_basedir.sqlite ' );
13
+ } catch (Exception $ e ) {
14
+ echo $ e ->getMessage () . "\n" ;
15
+ }
16
+ try {
17
+ $ db = new PDO ('sqlite:file:../not_in_open_basedir.sqlite ' );
18
+ } catch (Exception $ e ) {
19
+ echo $ e ->getMessage () . "\n" ;
20
+ }
21
+ try {
22
+ $ db = new PDO ('sqlite:file:../not_in_open_basedir.sqlite?mode=ro ' );
23
+ } catch (Exception $ e ) {
24
+ echo $ e ->getMessage () . "\n" ;
25
+ }
26
+
27
+ ?>
28
+ --EXPECT--
29
+ open_basedir prohibits opening ../not_in_open_basedir.sqlite
30
+ open_basedir prohibits opening file:../not_in_open_basedir.sqlite
31
+ open_basedir prohibits opening file:../not_in_open_basedir.sqlite?mode=ro
You can’t perform that action at this time.
0 commit comments