Судя по всему правильная сортировка никому не нужна

Порылся сам.
Судя по всему косяки в участке кода content.php:
(строки 1655 - 1673 в 1.1.3)
// location of current content item in array list
$prev = null;
$current = array_shift( $list );
$next = array_shift( $list );
while ( $current->id != $uid ) {
$prev = $current;
$current = $next;
$next = array_shift( $list );
}
$row->prev = '';
$row->next = '';
if ( !empty( $prev ) ) {
$row->prev = $prev->id;
$row->prev_title = $prev->title;
}
if ( !empty( $next ) ) {
$row->next = $next->id;
$row->next_title = $next->title;
}
При сортировки категории по автору выдаёт, например, адрес:
http://joostina/index.php?option=com_content&task=view&id=528&Itemid=
107Хотя правильно:
http://joostina/index.php?option=com_content&task=view&id=528&Itemid=
67
При попытке пойти по ссылке браузер выдаёт:
Fatal error: Maximum execution time of 30 seconds exceeded in Z:\home\joostina\www\components\com_content\content.php on line 1659
При этом jcomments версии 1.4.0.3 генерирует правильную ссылку, старшие версии уже нет.
Если заменить этот участок кода блоком из joomla 1.0.15, сортировка по тому же автору идёт нормально, но вылезают косяки во всех остальных местах.
// location of current content item in array list
$location = array_search( $uid, $list );
$row->prev = '';
$row->next = '';
if ( $location - 1 >= 0 ) {
// the previous content item cannot be in the array position -1
$row->prev = $list[$location - 1];
}
if ( ( $location + 1 ) < count( $list ) ) {
// the next content item cannot be in an array position greater than the number of array postions
$row->next = $list[$location + 1];
}
P.S. PHP я практически не знаю - просто когда-то давно программил под Си. Так что подход скорее интуиитивный.
