Development

Changeset 27752

You must first sign up to be able to contribute.

Changeset 27752

Show
Ignore:
Timestamp:
02/08/10 20:21:22 (1 month ago)
Author:
Kris.Wallsmith
Message:

[1.3, 1.4] fixed initializion of output escaper array iterator (closes #8202)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.3/lib/escaper/sfOutputEscaperArrayDecorator.class.php

    r9158 r27752  
    2626   */ 
    2727  private $count; 
     28 
     29  /** 
     30   * Constructor. 
     31   * 
     32   * @see sfOutputEscaper 
     33   */ 
     34  public function __construct($escapingMethod, $value) 
     35  { 
     36    parent::__construct($escapingMethod, $value); 
     37 
     38    $this->count = count($this->value); 
     39  } 
    2840 
    2941  /** 
     
    6779    next($this->value); 
    6880 
    69     $this->count --; 
     81    $this->count--; 
    7082  } 
    7183 
  • branches/1.3/test/unit/escaper/sfOutputEscaperArrayDecoratorTest.php

    r19531 r27752  
    2525sfConfig::set('sf_charset', 'UTF-8'); 
    2626 
    27 $t = new lime_test(10); 
     27$t = new lime_test(11); 
    2828 
    2929$a = array('<strong>escaped!</strong>', 1, null, array(2, '<strong>escaped!</strong>')); 
     
    8484  } 
    8585} 
     86 
     87// ->valid() 
     88$t->diag('->valid()'); 
     89 
     90$escaped = sfOutputEscaper::escape('esc_entities', array(1, 2, 3)); 
     91$t->is($escaped->valid(), true, '->valid() returns true if called before iteration'); 
  • branches/1.4/lib/escaper/sfOutputEscaperArrayDecorator.class.php

    r9158 r27752  
    2626   */ 
    2727  private $count; 
     28 
     29  /** 
     30   * Constructor. 
     31   * 
     32   * @see sfOutputEscaper 
     33   */ 
     34  public function __construct($escapingMethod, $value) 
     35  { 
     36    parent::__construct($escapingMethod, $value); 
     37 
     38    $this->count = count($this->value); 
     39  } 
    2840 
    2941  /** 
     
    6779    next($this->value); 
    6880 
    69     $this->count --; 
     81    $this->count--; 
    7082  } 
    7183 
  • branches/1.4/test/unit/escaper/sfOutputEscaperArrayDecoratorTest.php

    r19531 r27752  
    2525sfConfig::set('sf_charset', 'UTF-8'); 
    2626 
    27 $t = new lime_test(10); 
     27$t = new lime_test(11); 
    2828 
    2929$a = array('<strong>escaped!</strong>', 1, null, array(2, '<strong>escaped!</strong>')); 
     
    8484  } 
    8585} 
     86 
     87// ->valid() 
     88$t->diag('->valid()'); 
     89 
     90$escaped = sfOutputEscaper::escape('esc_entities', array(1, 2, 3)); 
     91$t->is($escaped->valid(), true, '->valid() returns true if called before iteration'); 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.