Skip to content

Commit

Permalink
If a user has no published items, do not display their K2 user page (…
Browse files Browse the repository at this point in the history
…in the frontend) and redirect to the homepage of the site.

This will help fight spammers who created profiles and link to these
profiles in other sites or forums.
  • Loading branch information
kavadas committed Mar 1, 2016
1 parent 464bdeb commit 922a7f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/com_k2/views/itemlist/view.html.php
Expand Up @@ -391,6 +391,11 @@ function display($tpl = null)
$items = $model->getData($ordering);
}

// If a user has no published items, do not display their K2 user page (in the frontend) and redirect to the homepage of the site.
if(count($items) == 0) {
$mainframe->redirect(JUri::root());
}

// Pagination
jimport('joomla.html.pagination');
$total = count($items) ? $model->getTotal() : 0;
Expand Down

0 comments on commit 922a7f4

Please sign in to comment.