~ubuntu-branches/ubuntu/gutsy/php5/gutsy

« back to all changes in this revision

Viewing changes to ext/filter/tests/011.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, CVE-2007-0905, CVE-2007-0906, CVE-2007-0909, CVE-2007-0910
  • Date: 2007-02-20 17:54:46 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070220175446-nudqyuv0dfowel3r
Tags: 5.2.1-0ubuntu1
* New upstream security/bugfix release:
  - safe_mode & open_basedir bypasses inside the session extension
    [CVE-2007-0905]
  - multiple buffer overflows in various extensions and functions
    [CVE-2007-0906]
  - underflow in the internal sapi_header_op() function [CVE-2007-0907]
  - information disclosure in the wddx extension [CVE-2007-0908]
  - string format vulnerability in *print() functions on 64 bit systems
    [CVE-2007-0909]
  - possible clobbering of super-globals in several code paths
    [CVE-2007-0910]
* Adapted patches to new upstream release:
  - 006-debian_quirks.patch
  - 034-apache2_umask_fix.patch
  - 044-strtod_arm_fix.patch
* Drop 109-libdb4.4.patch: Obsolete, upstream now checks for db 4.5 and 4.4.
* Drop 114-zend_alloc.c_m68k_alignment.patch and
  115-zend_alloc.c_memleak.patch: Applied upstream.
* Add debian/patches/000upstream-str_ireplace_offbyone.patch:
  - Fix off-by-one in str_ireplace(), a regression introduced in 5.2.1.
  - Patch taken from upstream CVS:
    http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.630&r2=1.631
  - CVE-2007-0911
* debian/control: Set Ubuntu maintainer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
--TEST--
2
2
input_get()
3
3
--SKIPIF--
4
 
<?php
5
 
/* TODO: Check why we get warnings 2x */
6
 
die("skip");
7
 
die("error mode cannot be changed via -d");
8
 
?>
 
4
<?php if (!extension_loaded("filter")) die("skip"); ?>
9
5
--GET--
10
6
a=<b>test</b>&b=http://example.com
11
7
--POST--
13
9
--FILE--
14
10
<?php
15
11
ini_set('html_errors', false);
16
 
var_dump(input_get(INPUT_GET, "a", FILTER_SANITIZE_STRIPPED));
17
 
var_dump(input_get(INPUT_GET, "b", FILTER_SANITIZE_URL));
18
 
var_dump(input_get(INPUT_GET, "a", FILTER_SANITIZE_SPECIAL_CHARS, array(1,2,3,4,5)));
19
 
var_dump(input_get(INPUT_GET, "b", FILTER_VALIDATE_FLOAT, new stdClass));
20
 
var_dump(input_get(INPUT_POST, "c", FILTER_SANITIZE_STRIPPED, array(5,6,7,8)));
21
 
var_dump(input_get(INPUT_POST, "d", FILTER_VALIDATE_FLOAT));
22
 
var_dump(input_get(INPUT_POST, "c", FILTER_SANITIZE_SPECIAL_CHARS));
23
 
var_dump(input_get(INPUT_POST, "d", FILTER_VALIDATE_INT));
24
 
 
25
 
var_dump(input_get(new stdClass, "d"));
26
 
 
27
 
var_dump(input_get(INPUT_POST, "c", "", ""));
28
 
var_dump(input_get("", "", "", "", ""));
29
 
var_dump(input_get(0, 0, 0, 0, 0));
 
12
var_dump(filter_input(INPUT_GET, "a", FILTER_SANITIZE_STRIPPED));
 
13
var_dump(filter_input(INPUT_GET, "b", FILTER_SANITIZE_URL));
 
14
var_dump(filter_input(INPUT_GET, "a", FILTER_SANITIZE_SPECIAL_CHARS, array(1,2,3,4,5)));
 
15
var_dump(filter_input(INPUT_GET, "b", FILTER_VALIDATE_FLOAT, new stdClass));
 
16
var_dump(filter_input(INPUT_POST, "c", FILTER_SANITIZE_STRIPPED, array(5,6,7,8)));
 
17
var_dump(filter_input(INPUT_POST, "d", FILTER_VALIDATE_FLOAT));
 
18
var_dump(filter_input(INPUT_POST, "c", FILTER_SANITIZE_SPECIAL_CHARS));
 
19
var_dump(filter_input(INPUT_POST, "d", FILTER_VALIDATE_INT));
 
20
 
 
21
var_dump(filter_var(new stdClass, "d"));
 
22
 
 
23
var_dump(filter_input(INPUT_POST, "c", "", ""));
 
24
var_dump(filter_var("", "", "", "", ""));
 
25
var_dump(filter_var(0, 0, 0, 0, 0));
30
26
 
31
27
echo "Done\n";
32
28
?>
34
30
string(4) "test"
35
31
string(18) "http://example.com"
36
32
string(27) "&#60;b&#62;test&#60;/b&#62;"
 
33
 
 
34
Notice: Object of class stdClass could not be converted to int in %s/011.php on line %d
37
35
bool(false)
38
36
string(6) "string"
39
37
float(12345.7)
40
38
string(29) "&#60;p&#62;string&#60;/p&#62;"
41
39
bool(false)
42
40
 
43
 
Warning: input_get() expects parameter 1 to be long, object given in %s on line %d
44
 
NULL
45
 
 
46
 
Warning: input_get() expects parameter 3 to be long, string given in %s on line %d
47
 
NULL
48
 
 
49
 
Warning: input_get() expects parameter 1 to be long, string given in %s on line %d
50
 
NULL
 
41
Warning: filter_var() expects parameter 2 to be long, string given in %s/011.php on line %d
 
42
NULL
 
43
 
 
44
Warning: filter_input() expects parameter 3 to be long, string given in %s/011.php on line %d
 
45
NULL
 
46
 
 
47
Warning: filter_var() expects at most 3 parameters, 5 given in %s/011.php on line %d
 
48
NULL
 
49
 
 
50
Warning: filter_var() expects at most 3 parameters, 5 given in %s/011.php on line %d
51
51
NULL
52
52
Done