#583 Rewrite of URL-parameter for orphan_pages

CVS
open
nobody
Wiki (64)
5
2010-12-16
2010-12-16
harimix
No

I have found some code fragment in orphan_pages.php that actually is not effective.

/wiki/orphan_pages.php
...
if( !empty( $_REQUEST['sort_mode'] )) {
$listHash['sort_mode'] = preg_replace( '/^user_/', 'creator_user_', $_REQUEST['sort_mode'] );
}
$listHash = $_REQUEST;
$listHash['extras'] = TRUE;
$listHash['orphans_only'] = TRUE;
$listpages = $gContent->getList( $listHash );
...

The if statement is acutally overwritten by the next assignment to $listhash. I'm not quite sure what is the purpose of rewritting the URL-parameter "user". I assume the correct code fragment should look something like this:

...
$listHash = $_REQUEST;
$listHash['extras'] = TRUE;
$listHash['orphans_only'] = TRUE;
if( !empty( $_REQUEST['sort_mode'] )) {
$listHash['sort_mode'] = preg_replace( '/^user_/', 'creator_user_', $_REQUEST['sort_mode'] );
}
$listpages = $gContent->getList( $listHash );
...

Discussion