Development

Changeset 6468

You must first sign up to be able to contribute.

Changeset 6468

Show
Ignore:
Timestamp:
12/11/07 21:28:45 (10 months ago)
Author:
fabien
Message:

fixed sfOutputEscaperObjectDecorator::toString() as PHP 5.2.5 does not allow exception in toString() methods (closes #2630)

Files:

Legend:

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

    r5849 r6468  
    9393   * 
    9494   * @return string 
    95    * 
    96    * @throws <b>sfException</b> 
    9795   */ 
    9896  public function __toString() 
    9997  { 
    100     if (method_exists($this->value, '__toString')) 
    101     { 
    102       return $this->escape($this->escapingMethod, $this->value->__toString()); 
    103     } 
    104     else 
    105     { 
    106       throw new sfException(sprintf('Object of class "%s" cannot be converted to string (Please create a __toString() method).', get_class($this->value))); 
    107     } 
     98    return $this->escape($this->escapingMethod, $this->value->__toString()); 
    10899  } 
    109100}