bug76296.phpt 539 B

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