Skip to content

Commit

Permalink
Check for empty titles in search plugin
Browse files Browse the repository at this point in the history
There is a possibility that the title of a message is empty when the forum has been migrated from a third-party forum. If this happens, the search plugin will create unclickable links.
  • Loading branch information
Ronny Schmatzler committed Jul 16, 2015
1 parent 140c8e3 commit e34609a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/search/kunena/kunena.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ function plgSearchKunena($text, $phrase = '', $ordering = '', $areas = null) {
$row = new StdClass();
$row->id = $message->id;
$row->href = $message->getUrl();
//Check if the title of the post is empty and make sure
//that there's not an unclickable link created
if ($message->subject == NULL) {
$row->title = "Message title is empty";
} else {
$row->title = JString::substr($message->subject, '0', $contentLimit);
}
$row->section = $message->getCategory()->name;
$row->created = $message->time;
if ($bbcode) {
Expand Down

0 comments on commit e34609a

Please sign in to comment.