Ticket #223 (closed Bug: fixed)

Opened 13 months ago

Last modified 13 months ago

Pagination has the __toString() bug on PHP 5.1.6

Reported by: dynom Owned by:
Priority: major Milestone: 2.1
Component: Core Version: SVN HEAD
Keywords: PHP5.1 toString Cc:

Description

in Pagination::create_links() there is a toString() call in View();

public function create_links($style = NULL) {

$style = (isset($style)) ? $style : $this->style; return (string)new View(trim($this->directory, '/').'/'.$style, get_object_vars($this)) ;

}

This way of returning fails the toString() call on PHP 5.1.6. To fix this, call View()->render(). e.g.:

public function create_links($style = NULL) {

$style = (isset($style)) ? $style : $this->style; $view = new View(trim($this->directory, '/').'/'.$style, get_object_vars($this));

return (string) $view->render();

}

Change History

Changed 13 months ago by PugFish

  • status changed from new to closed
  • resolution set to fixed

Fixed in r1226

Changed 13 months ago by Shadowhand

  • keywords PHP5.1 toString added; PHP5.1.6,__tostring removed
  • version set to SVN HEAD
  • milestone changed from 2.0 to 2.1
Note: See TracTickets for help on using tickets.