RSS en ordre inverse (bug #1843853) + bugfix sous PHP5 (le fameux clone bug)
This commit is contained in:
parent
f5e3a62ee8
commit
1c84a36c69
3 changed files with 10 additions and 5 deletions
12
rss.php
12
rss.php
|
|
@ -14,6 +14,12 @@ set_include_path(get_include_path() . PATH_SEPARATOR . getcwd());
|
|||
require_once 'strip_manager.php';
|
||||
require_once 'configuration.php';
|
||||
|
||||
// hack for passing objects by values instead of reference under PHP5 (but not PHP4)
|
||||
// damn clone keyword !
|
||||
if (version_compare(phpversion(), '5.0') < 0) {
|
||||
eval('function clone($object) {return $object;}');
|
||||
}
|
||||
|
||||
/**
|
||||
* RSS manager
|
||||
*/
|
||||
|
|
@ -47,13 +53,13 @@ class rss_manager
|
|||
|
||||
$sm->strips_list_get();
|
||||
|
||||
for( $i = 0; $i < $sm->strips_count; $i++ ) {
|
||||
for( $i = $sm->strips_count-1; $i >= 0; $i-- ) { // reverser order
|
||||
$sm->strip_info_get( $i );
|
||||
|
||||
|
||||
// conversion iso8601 -> RFC822
|
||||
$sm->date = date('r', strtotime($sm->date));
|
||||
|
||||
$this->items_list[] = $sm;
|
||||
$this->items_list[] = clone($sm); // hack for php4/5 compat
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue