Development

Changeset 6469

You must first sign up to be able to contribute.

Changeset 6469

Show
Ignore:
Timestamp:
12/11/07 21:29:10 (2 years 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
  • branches/1.0/lib/view/escaper/sfOutputEscaperObjectDecorator.class.php

    r5850 r6469  
    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} 

The Sensio Labs Network

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