xref: /PHP-5.3/ext/oci8/tests/null_byte_1.phpt (revision 2ea52b1f)
1--TEST--
2Protect against null bytes in LOB filenames (http://news.php.net/php.internals/50202)
3--SKIPIF--
4<?php if (!extension_loaded('oci8')) die ("skip no oci8 extension"); ?>
5--INI--
6display_errors = On
7error_reporting = E_WARNING
8--FILE--
9<?php
10
11require(dirname(__FILE__).'/connect.inc');
12
13// Run Test
14
15echo "Test 1: Import\n";
16
17$lob = oci_new_descriptor($c, OCI_D_LOB);
18$r = $lob->savefile("/tmp/abc\0def");
19var_dump($r);
20
21echo "Test 2: Export\n";
22
23$r = $lob->export("/tmp/abc\0def");
24var_dump($r);
25
26?>
27===DONE===
28<?php exit(0); ?>
29--EXPECTF--
30Test 1: Import
31
32Warning: OCI-Lob::savefile(): Filename cannot contain null bytes in %snull_byte_1.php on line %d
33bool(false)
34Test 2: Export
35
36Warning: OCI-Lob::export(): Filename cannot contain null bytes in %snull_byte_1.php on line %d
37bool(false)
38===DONE===
39