xref: /PHP-7.2/ext/openssl/tests/bug76296.phpt (revision f1d7e3ca)
1--TEST--
2Bug #76296 openssl_pkey_get_public does not respect open_basedir
3--SKIPIF--
4<?php if (!extension_loaded("openssl")) print "skip"; ?>
5--FILE--
6<?php
7$dir = __DIR__ . '/bug76296_openbasedir';
8$pem = 'file://' . __DIR__ . '/public.key';
9if (!is_dir($dir)) {
10    mkdir($dir);
11}
12
13ini_set('open_basedir', $dir);
14
15var_dump(openssl_pkey_get_public($pem));
16?>
17--EXPECTF--
18Warning: openssl_pkey_get_public(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s) in %s on line %d
19bool(false)
20--CLEAN--
21@rmdir(__DIR__ . '/bug76296_openbasedir');
22