Skip to content

Commit

Permalink
Fix for potential security issue, if the main list query errors out, …
Browse files Browse the repository at this point in the history
…we currently then show the affected query, which reveals table names. We now only append the broken query msg if in debug mode (so either Fabrik debug mode is enabled, or J! global debug)
  • Loading branch information
cheesegrits committed Oct 10, 2016
1 parent 58a3658 commit ce129cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,23 +339,20 @@ public function getCanAdd()
{
if (!isset($this->canAdd))
{
$params = $this->getParams();
$lists = (array) $params->get('fullcalendar_table');
$params = $this->getParams();
$lists = (array) $params->get('fullcalendar_table');
$this->canAdd = false;

foreach ($lists as $id)
{
$listModel = JModelLegacy::getInstance('list', 'FabrikFEModel');
$listModel->setId($id);

if (!$listModel->canAdd())
if ($listModel->canAdd())
{
$this->canAdd = false;

return false;
$this->canAdd = true;
}
}

$this->canAdd = true;
}

return $this->canAdd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ public function chooseAddEvent()
$usersConfig = JComponentHelper::getParams('com_fabrik');
$model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0))));
$rows = $model->getEventLists();

foreach ($rows as $rowkey => $row) {
$listModel = JModelLegacy::getInstance('List', 'FabrikFEModel');
$listModel->setId($row->value);
if (!$listModel->canAdd())
{
unset($rows[$rowkey]);
}
}

$model->getVisualization();
$options = array();
$options[] = JHTML::_('select.option', '', FText::_('PLG_VISUALIZATION_FULLCALENDAR_PLEASE_SELECT'));
Expand Down

1 comment on commit ce129cd

@cheesegrits
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops, wrong commit message.

Added checking canAdd() on lists and not showing them in the 'choose event' window if not.

Please sign in to comment.