Skip to content

Commit

Permalink
minor code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepereiradasilva committed Jul 20, 2016
1 parent 9132e07 commit 206ce46
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libraries/cms/helper/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,14 @@ public function createTagsFromField($tags)
{
// We will use the tags table to store them
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/tables');
$tagTable = JTable::getInstance('Tag', 'TagsTable');
$newTags = array();
$tagTable = JTable::getInstance('Tag', 'TagsTable');
$newTags = array();
$canCreate = JFactory::getUser()->authorise('core.create', 'com_tags');

foreach ($tags as $key => $tag)
{
// User is not allowed to create tags, so don't create.
if (strpos($tag, '#new#') !== false && !JFactory::getUser()->authorise('core.create', 'com_tags'))
if (strpos($tag, '#new#') !== false && !$canCreate)
{
continue;
}
Expand Down

0 comments on commit 206ce46

Please sign in to comment.