/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/sqlite3/tests/sqlite3_21_security.phpt
41 строка
870 B
Max Semenik
Migrate skip checks to --EXTENSIONS--, p4
08 апр 2021, 11:36
08 апр 2021, 11:36
7f2f0c0
Код
Авторство
О чём код?
--TEST-- SQLite3 open_basedir checks --EXTENSIONS-- sqlite3 --INI-- open_basedir=. --FILE-- <?php chdir(__DIR__); $directory = __DIR__ . '/'; $file = uniqid() . '.db'; echo "Within test directory\n"; $db = new SQLite3($directory . $file); var_dump($db); var_dump($db->close()); unlink($directory . $file); echo "Above test directory\n"; try { $db = new SQLite3('../bad' . $file); } catch (Exception $e) { echo $e . "\n"; } echo "Done\n"; ?> --EXPECTF-- Within test directory object(SQLite3)#%d (0) { } bool(true) Above test directory Warning: SQLite3::__construct(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %ssqlite3_21_security.php on line %d Exception: open_basedir prohibits opening %s in %ssqlite3_21_security.php:%d Stack trace: #0 %ssqlite3_21_security.php(%d): SQLite3->__construct('%s') #1 {main} Done