~clint-fewbar/ubuntu/precise/php5/php5-5.4-merge

« back to all changes in this revision

Viewing changes to ext/oci8/tests/null_byte_1.phpt

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-02-22 09:46:37 UTC
  • mfrom: (1.1.20) (0.3.18 sid)
  • Revision ID: package-import@ubuntu.com-20110222094637-nlu2tvb7oqgaarl0
Tags: 5.3.5-1ubuntu1
* Merge from debian/unstable. Remaining changes:
 - debian/control:
    * Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    * Dropped libmysqlclient15-dev, build against mysql 5.1.
    * Dropped libcurl-dev not in the archive.
    * Suggest php5-suhosin rather than recommends.
    * Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions 
      already in universe.
    * Dropped libonig-dev and libqgdbm since its in universe. (will be re-added in lucid+1)
    * Dropped locales-all.
  - modulelist: Drop imap, interbase, sybase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
    * stop mysql instance on clean just in case we failed in tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Protect 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--
 
6
display_errors = On
 
7
error_reporting = E_WARNING
 
8
--FILE--
 
9
<?php
 
10
 
 
11
require(dirname(__FILE__).'/connect.inc');
 
12
 
 
13
// Run Test
 
14
 
 
15
echo "Test 1: Import\n";
 
16
 
 
17
$lob = oci_new_descriptor($c, OCI_D_LOB);
 
18
$r = $lob->savefile("/tmp/abc\0def");
 
19
var_dump($r);
 
20
 
 
21
echo "Test 2: Export\n";
 
22
 
 
23
$r = $lob->export("/tmp/abc\0def");
 
24
var_dump($r);
 
25
 
 
26
?>
 
27
===DONE===
 
28
<?php exit(0); ?>
 
29
--EXPECTF--
 
30
Test 1: Import
 
31
 
 
32
Warning: OCI-Lob::savefile(): Filename cannot contain null bytes in %snull_byte_1.php on line %d
 
33
bool(false)
 
34
Test 2: Export
 
35
 
 
36
Warning: OCI-Lob::export(): Filename cannot contain null bytes in %snull_byte_1.php on line %d
 
37
bool(false)
 
38
===DONE===