Development

Changeset 5850

You must first sign up to be able to contribute.

Changeset 5850

Show
Ignore:
Timestamp:
11/04/07 16:53:01 (10 months ago)
Author:
fabien
Message:

fixed sfOutputEscaperObjectDecorator::toString doesn't escape (closes #2321)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/lib/view/escaper/sfOutputEscaperObjectDecorator.class.php

    r3232 r5850  
    100100    if (method_exists($this->value, '__toString')) 
    101101    { 
    102       return $this->value->__toString(); 
     102      return $this->escape($this->escapingMethod, $this->value->__toString()); 
    103103    } 
    104104    else 
  • branches/1.0/test/unit/view/escaper/sfOutputEscaperObjectDecoratorTest.php

    r4262 r5850  
    2525sfConfig::set('sf_charset', 'UTF-8'); 
    2626 
    27 $t = new lime_test(2, new lime_output_color()); 
     27$t = new lime_test(3, new lime_output_color()); 
    2828 
    2929class OutputEscaperTest 
    3030{ 
     31  public function __toString() 
     32  { 
     33    return $this->getTitle(); 
     34  } 
     35 
    3136  public function getTitle() 
    3237  { 
     
    4752$array = $escaped->getTitles(); 
    4853$t->is($array[2], '<strong>escaped!</strong>', 'The escaped object behaves like the real object'); 
     54 
     55// __toString() 
     56$t->diag('__toString()'); 
     57 
     58$t->is($escaped->__toString(), '<strong>escaped!</strong>', 'The escaped object behaves like the real object');