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

@@ -188,13 +188,16 @@ class ComponentbuilderViewServers extends JViewLegacy
// Set Name Selection
$this->nameOptions = $this->getTheNameSelections();
if ($this->nameOptions)
// We do some sanitation for Name filter
if (ComponentbuilderHelper::checkArray($this->nameOptions) &&
isset($this->nameOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->nameOptions[0]->value))
{
unset($this->nameOptions[0]);
}
// Only load Name filter if it has values
if (ComponentbuilderHelper::checkArray($this->nameOptions))
{
// We do some sanitation for Name filter
if (isset($this->nameOptions[0]) && !ComponentbuilderHelper::checkString($this->nameOptions[0]->value))
{
unset($this->nameOptions[0]);
}
// Name Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_COMPONENTBUILDER_SERVER_NAME_LABEL').' -',
@@ -215,13 +218,16 @@ class ComponentbuilderViewServers extends JViewLegacy
// Set Protocol Selection
$this->protocolOptions = $this->getTheProtocolSelections();
if ($this->protocolOptions)
// We do some sanitation for Protocol filter
if (ComponentbuilderHelper::checkArray($this->protocolOptions) &&
isset($this->protocolOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->protocolOptions[0]->value))
{
unset($this->protocolOptions[0]);
}
// Only load Protocol filter if it has values
if (ComponentbuilderHelper::checkArray($this->protocolOptions))
{
// We do some sanitation for Protocol filter
if (isset($this->protocolOptions[0]) && !ComponentbuilderHelper::checkString($this->protocolOptions[0]->value))
{
unset($this->protocolOptions[0]);
}
// Protocol Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_COMPONENTBUILDER_SERVER_PROTOCOL_LABEL').' -',