Kunena 7.0.9 & Kunena 6.4.14 – Security Updates Released

The Kunena team has announce the arrival of Kunena 7.0.9 [K 7.0.9] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x./6.1.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0

Topics that are moved into this category are generally considered to be closed. Users may want to add additional information but these topics should not be resurrected in order to discuss new problems or unrelated matters.

Question Kunena.link.class.php error on line 503

More
14 years 11 months ago - 14 years 11 months ago #109314 by ricoux
Hello all,

I encountered a problem with my kunena forum since I've updated it (1.6.5 to 1.7.0). All my categories are moderated and have the "Review posts setting" set to TRUE. When I want to write a new subject, I have this php error just after submit:

Notice: Trying to get property of non-object in components/com_kunena/lib/kunena.link.class.php on line 503

When I set to false the "Review posts setting" I've no problem. When I write a post in a non empty category, I've no problem too.

I've searched line 503 in the source code, in GetMessageUrl function:
Code:
return KunenaRoute::_ ( KUNENA_LIVEURLREL . '&func=showcat&catid=' . $result->catid, $xhtml );
The problem is $result, which is null.

I've isolated problematic code
Code:
$kunena_db->setQuery ( "SELECT a.thread AS thread, {$maxmin}(a.id) AS latest_id, MAX(a.catid) AS catid, COUNT(*) AS totalmessages FROM #__kunena_messages AS a, (SELECT thread FROM #__kunena_messages WHERE id={$kunena_db->Quote($pid)}) AS b WHERE a.thread = b.thread AND a.hold IN ({$hold}) AND a.id {$topic_ordering} {$kunena_db->Quote($pid)} GROUP BY a.thread" ); $result = $kunena_db->loadObject (); if (KunenaError::checkDatabaseError()) return; if (! is_object ( $result )) return KunenaRoute::_ ( KUNENA_LIVEURLREL . '&func=showcat&catid=' . $result->catid, $xhtml ); return CKunenaLink::GetThreadPageURL ( 'view', $result->catid, $result->thread, ceil ( $result->totalmessages / $limit ), $limit, $result->latest_id, $xhtml );

In the case of an empty category, the query return nothing. So $result is not an object, but we do $result->catid...

Thank you in advance for your answers.
Ricou


Report configuration settings :

Warning: Spoiler!
Last edit: 14 years 11 months ago by xillibit.

Please Log in or Create an account to join the conversation.

More
14 years 11 months ago #109316 by ricoux
Sorry I've posted in a wrong topic...

Please Log in or Create an account to join the conversation.

More
14 years 11 months ago #109330 by xillibit
Hello,

I will try to reproduce the issue on my own test system

I don't provide support by PM, because this can be useful for someone else.

Please Log in or Create an account to join the conversation.

Time to create page: 0.288 seconds