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

« back to all changes in this revision

Viewing changes to Zend/tests/bug36214.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
--TEST--
 
2
Bug #36214 (__get method works properly only when conditional operator is used)
 
3
--SKIPIF--
 
4
<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?>
 
5
--FILE--
 
6
<?php
 
7
class context {
 
8
  public $stack = array();
 
9
 
 
10
  public function __set($name,$var) {
 
11
    $this->stack[$name] = $var;return;
 
12
  }
 
13
 
 
14
  public function &__get($name) {
 
15
    return $this->stack[$name];
 
16
  }
 
17
}
 
18
 
 
19
$ctx = new context;
 
20
$ctx->comment_preview = array();
 
21
$ctx->comment_preview[0] = 1;
 
22
$ctx->comment_preview[1] = 2;
 
23
var_dump($ctx->comment_preview);
 
24
 
 
25
$comment_preview = array();
 
26
$comment_preview[0] = 1;
 
27
$comment_preview[1] = 2;
 
28
$ctx->comment_preview = $comment_preview;
 
29
var_dump($ctx->comment_preview);
 
30
 
 
31
$ctx->comment_preview = new ArrayObject();
 
32
$ctx->comment_preview[0] = 1;
 
33
$ctx->comment_preview[1] = 2;
 
34
var_dump($ctx->comment_preview);
 
35
?>
 
36
--EXPECT--
 
37
array(2) {
 
38
  [0]=>
 
39
  int(1)
 
40
  [1]=>
 
41
  int(2)
 
42
}
 
43
array(2) {
 
44
  [0]=>
 
45
  int(1)
 
46
  [1]=>
 
47
  int(2)
 
48
}
 
49
object(ArrayObject)#2 (2) {
 
50
  [0]=>
 
51
  int(1)
 
52
  [1]=>
 
53
  int(2)
 
54
}