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
|
|
@ -18,7 +18,7 @@ class configuration
|
|||
/**
|
||||
* URL of the website
|
||||
*/
|
||||
var $url = 'http://www.nojhan.net/geekscottes';
|
||||
var $url = 'http://localhost/~nojhan/stripit/trunk';
|
||||
|
||||
/**
|
||||
* Title of the website
|
||||
|
|
|
|||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -241,7 +241,6 @@ class strip_manager
|
|||
* @param integer index of the file to parse in the {@link $strips_list}
|
||||
*/
|
||||
function strip_info_get( $element_asked ) {
|
||||
|
||||
$this->current_id = $element_asked;
|
||||
|
||||
$file = $this->strips_list[$element_asked];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue