Moved the filter sanitation to insure no empty filters will get loaded

This commit is contained in:
2019-06-05 13:14:05 +02:00
parent e1f32c142b
commit 4a878e32ef
16 changed files with 362 additions and 242 deletions

View File

@@ -218,13 +218,16 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy
// Set Companyname Selection
$this->companynameOptions = $this->getTheCompanynameSelections();
if ($this->companynameOptions)
// We do some sanitation for Companyname filter
if (ComponentbuilderHelper::checkArray($this->companynameOptions) &&
isset($this->companynameOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->companynameOptions[0]->value))
{
unset($this->companynameOptions[0]);
}
// Only load Companyname filter if it has values
if (ComponentbuilderHelper::checkArray($this->companynameOptions))
{
// We do some sanitation for Companyname filter
if (isset($this->companynameOptions[0]) && !ComponentbuilderHelper::checkString($this->companynameOptions[0]->value))
{
unset($this->companynameOptions[0]);
}
// Companyname Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL').' -',
@@ -245,13 +248,16 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy
// Set Author Selection
$this->authorOptions = $this->getTheAuthorSelections();
if ($this->authorOptions)
// We do some sanitation for Author filter
if (ComponentbuilderHelper::checkArray($this->authorOptions) &&
isset($this->authorOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->authorOptions[0]->value))
{
unset($this->authorOptions[0]);
}
// Only load Author filter if it has values
if (ComponentbuilderHelper::checkArray($this->authorOptions))
{
// We do some sanitation for Author filter
if (isset($this->authorOptions[0]) && !ComponentbuilderHelper::checkString($this->authorOptions[0]->value))
{
unset($this->authorOptions[0]);
}
// Author Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL').' -',