From e1f32c142be517326d6a1d3976252d57c010421f Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 5 Jun 2019 12:50:42 +0200 Subject: [PATCH] Fixed filter to not display 'Select an option' but the field name instead --- README.md | 2 +- admin/README.txt | 2 +- admin/helpers/compiler/e_Interpretation.php | 12 ++++++++++ admin/views/admin_views/view.html.php | 25 ++++++++++++++++++++ admin/views/custom_admin_views/view.html.php | 15 ++++++++++++ admin/views/custom_codes/view.html.php | 20 ++++++++++++++++ admin/views/dynamic_gets/view.html.php | 10 ++++++++ admin/views/fields/view.html.php | 25 ++++++++++++++++++++ admin/views/help_documents/view.html.php | 20 ++++++++++++++++ admin/views/joomla_components/view.html.php | 10 ++++++++ admin/views/layouts/view.html.php | 10 ++++++++ admin/views/libraries/view.html.php | 10 ++++++++ admin/views/servers/view.html.php | 10 ++++++++ admin/views/site_views/view.html.php | 15 ++++++++++++ admin/views/snippets/view.html.php | 10 ++++++++ admin/views/templates/view.html.php | 10 ++++++++ 16 files changed, 204 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f3ce4550c..51a1eca66 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ TODO + *Version*: 2.9.18 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **206365** ++ *Line count*: **206555** + *Field count*: **1136** + *File count*: **1344** + *Folder count*: **209** diff --git a/admin/README.txt b/admin/README.txt index f3ce4550c..51a1eca66 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -150,7 +150,7 @@ TODO + *Version*: 2.9.18 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **206365** ++ *Line count*: **206555** + *Field count*: **1136** + *File count*: **1344** + *Folder count*: **209** diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index eec7d570d..88acd3488 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -10854,6 +10854,8 @@ class Interpretation extends Fields { if (isset($this->filterBuilder[$view]) && ComponentbuilderHelper::checkArray($this->filterBuilder[$view])) { + // get component name + $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; $otherFilter = array(); foreach ($this->filterBuilder[$view] as $filter) { @@ -10866,6 +10868,11 @@ class Interpretation extends Fields $otherFilter[] = $this->_t(2) . "\$this->" . $codeName . "Options = JFormHelper::loadFieldType('" . $type . "')->options;"; $otherFilter[] = $this->_t(2) . "if (\$this->" . $codeName . "Options)"; $otherFilter[] = $this->_t(2) . "{"; + $otherFilter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " We do some sanitation for " . $Codename . " filter"; + $otherFilter[] = $this->_t(3) . "if (isset(\$this->" . $codeName . "Options[0]) && !" . $Component . "Helper::checkString(\$this->" . $codeName . "Options[0]->value))"; + $otherFilter[] = $this->_t(3) . "{"; + $otherFilter[] = $this->_t(4) . "unset(\$this->" . $codeName . "Options[0]);"; + $otherFilter[] = $this->_t(3) . "}"; $otherFilter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " " . $CodeName . " Filter"; $otherFilter[] = $this->_t(3) . "JHtmlSidebar::addFilter("; $otherFilter[] = $this->_t(4) . "'- Select '.JText:" . ":_('" . $filter['lang'] . "').' -',"; @@ -10900,6 +10907,11 @@ class Interpretation extends Fields $otherFilter[] = $this->_t(2) . "\$this->" . $filter['code'] . "Options = " . $functionName; $otherFilter[] = $this->_t(2) . "if (\$this->" . $filter['code'] . "Options)"; $otherFilter[] = $this->_t(2) . "{"; + $otherFilter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " We do some sanitation for " . $Codename . " filter"; + $otherFilter[] = $this->_t(3) . "if (isset(\$this->" . $filter['code'] . "Options[0]) && !" . $Component . "Helper::checkString(\$this->" . $filter['code'] . "Options[0]->value))"; + $otherFilter[] = $this->_t(3) . "{"; + $otherFilter[] = $this->_t(4) . "unset(\$this->" . $filter['code'] . "Options[0]);"; + $otherFilter[] = $this->_t(3) . "}"; $otherFilter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " " . $Codename . " Filter"; $otherFilter[] = $this->_t(3) . "JHtmlSidebar::addFilter("; $otherFilter[] = $this->_t(4) . "'- Select '.JText:" . ":_('" . $filter['lang'] . "').' -',"; diff --git a/admin/views/admin_views/view.html.php b/admin/views/admin_views/view.html.php index fa4c172f9..62e27a410 100644 --- a/admin/views/admin_views/view.html.php +++ b/admin/views/admin_views/view.html.php @@ -195,6 +195,11 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy $this->add_fadeinOptions = $this->getTheAdd_fadeinSelections(); if ($this->add_fadeinOptions) { + // We do some sanitation for Add Fadein filter + if (isset($this->add_fadeinOptions[0]) && !ComponentbuilderHelper::checkString($this->add_fadeinOptions[0]->value)) + { + unset($this->add_fadeinOptions[0]); + } // Add Fadein Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_FADEIN_LABEL').' -', @@ -217,6 +222,11 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy $this->typeOptions = $this->getTheTypeSelections(); if ($this->typeOptions) { + // We do some sanitation for Type filter + if (isset($this->typeOptions[0]) && !ComponentbuilderHelper::checkString($this->typeOptions[0]->value)) + { + unset($this->typeOptions[0]); + } // Type Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_TYPE_LABEL').' -', @@ -239,6 +249,11 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy $this->add_custom_importOptions = $this->getTheAdd_custom_importSelections(); if ($this->add_custom_importOptions) { + // We do some sanitation for Add Custom Import filter + if (isset($this->add_custom_importOptions[0]) && !ComponentbuilderHelper::checkString($this->add_custom_importOptions[0]->value)) + { + unset($this->add_custom_importOptions[0]); + } // Add Custom Import Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -', @@ -261,6 +276,11 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy $this->add_custom_buttonOptions = $this->getTheAdd_custom_buttonSelections(); if ($this->add_custom_buttonOptions) { + // We do some sanitation for Add Custom Button filter + if (isset($this->add_custom_buttonOptions[0]) && !ComponentbuilderHelper::checkString($this->add_custom_buttonOptions[0]->value)) + { + unset($this->add_custom_buttonOptions[0]); + } // Add Custom Button Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -', @@ -283,6 +303,11 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy $this->add_php_ajaxOptions = $this->getTheAdd_php_ajaxSelections(); if ($this->add_php_ajaxOptions) { + // We do some sanitation for Add Php Ajax filter + if (isset($this->add_php_ajaxOptions[0]) && !ComponentbuilderHelper::checkString($this->add_php_ajaxOptions[0]->value)) + { + unset($this->add_php_ajaxOptions[0]); + } // Add Php Ajax Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_AJAX_LABEL').' -', diff --git a/admin/views/custom_admin_views/view.html.php b/admin/views/custom_admin_views/view.html.php index 766ece13e..04072c852 100644 --- a/admin/views/custom_admin_views/view.html.php +++ b/admin/views/custom_admin_views/view.html.php @@ -195,6 +195,11 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy $this->main_getNameOptions = JFormHelper::loadFieldType('Maingets')->options; if ($this->main_getNameOptions) { + // We do some sanitation for filter + if (isset($this->main_getNameOptions[0]) && !ComponentbuilderHelper::checkString($this->main_getNameOptions[0]->value)) + { + unset($this->main_getNameOptions[0]); + } // Main Get Name Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_MAIN_GET_LABEL').' -', @@ -217,6 +222,11 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy $this->add_php_ajaxOptions = $this->getTheAdd_php_ajaxSelections(); if ($this->add_php_ajaxOptions) { + // We do some sanitation for Add Php Ajax filter + if (isset($this->add_php_ajaxOptions[0]) && !ComponentbuilderHelper::checkString($this->add_php_ajaxOptions[0]->value)) + { + unset($this->add_php_ajaxOptions[0]); + } // Add Php Ajax Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_AJAX_LABEL').' -', @@ -239,6 +249,11 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy $this->add_custom_buttonOptions = $this->getTheAdd_custom_buttonSelections(); if ($this->add_custom_buttonOptions) { + // We do some sanitation for Add Custom Button filter + if (isset($this->add_custom_buttonOptions[0]) && !ComponentbuilderHelper::checkString($this->add_custom_buttonOptions[0]->value)) + { + unset($this->add_custom_buttonOptions[0]); + } // Add Custom Button Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -', diff --git a/admin/views/custom_codes/view.html.php b/admin/views/custom_codes/view.html.php index bab1ad5e3..729900b2e 100644 --- a/admin/views/custom_codes/view.html.php +++ b/admin/views/custom_codes/view.html.php @@ -195,6 +195,11 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy $this->componentSystem_nameOptions = JFormHelper::loadFieldType('Component')->options; if ($this->componentSystem_nameOptions) { + // We do some sanitation for filter + if (isset($this->componentSystem_nameOptions[0]) && !ComponentbuilderHelper::checkString($this->componentSystem_nameOptions[0]->value)) + { + unset($this->componentSystem_nameOptions[0]); + } // Component System Name Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL').' -', @@ -217,6 +222,11 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy $this->targetOptions = $this->getTheTargetSelections(); if ($this->targetOptions) { + // We do some sanitation for Target filter + if (isset($this->targetOptions[0]) && !ComponentbuilderHelper::checkString($this->targetOptions[0]->value)) + { + unset($this->targetOptions[0]); + } // Target Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL').' -', @@ -239,6 +249,11 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy $this->typeOptions = $this->getTheTypeSelections(); if ($this->typeOptions) { + // We do some sanitation for Type filter + if (isset($this->typeOptions[0]) && !ComponentbuilderHelper::checkString($this->typeOptions[0]->value)) + { + unset($this->typeOptions[0]); + } // Type Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL').' -', @@ -261,6 +276,11 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy $this->comment_typeOptions = $this->getTheComment_typeSelections(); if ($this->comment_typeOptions) { + // We do some sanitation for Comment Type filter + if (isset($this->comment_typeOptions[0]) && !ComponentbuilderHelper::checkString($this->comment_typeOptions[0]->value)) + { + unset($this->comment_typeOptions[0]); + } // Comment Type Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL').' -', diff --git a/admin/views/dynamic_gets/view.html.php b/admin/views/dynamic_gets/view.html.php index 503b3f647..1ab2ae334 100644 --- a/admin/views/dynamic_gets/view.html.php +++ b/admin/views/dynamic_gets/view.html.php @@ -195,6 +195,11 @@ class ComponentbuilderViewDynamic_gets extends JViewLegacy $this->main_sourceOptions = $this->getTheMain_sourceSelections(); if ($this->main_sourceOptions) { + // We do some sanitation for Main Source filter + if (isset($this->main_sourceOptions[0]) && !ComponentbuilderHelper::checkString($this->main_sourceOptions[0]->value)) + { + unset($this->main_sourceOptions[0]); + } // Main Source Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_MAIN_SOURCE_LABEL').' -', @@ -217,6 +222,11 @@ class ComponentbuilderViewDynamic_gets extends JViewLegacy $this->gettypeOptions = $this->getTheGettypeSelections(); if ($this->gettypeOptions) { + // We do some sanitation for Gettype filter + if (isset($this->gettypeOptions[0]) && !ComponentbuilderHelper::checkString($this->gettypeOptions[0]->value)) + { + unset($this->gettypeOptions[0]); + } // Gettype Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_GETTYPE_LABEL').' -', diff --git a/admin/views/fields/view.html.php b/admin/views/fields/view.html.php index 3fd6a7d6b..596391e67 100644 --- a/admin/views/fields/view.html.php +++ b/admin/views/fields/view.html.php @@ -212,6 +212,11 @@ class ComponentbuilderViewFields extends JViewLegacy $this->fieldtypeNameOptions = JFormHelper::loadFieldType('Fieldtypes')->options; if ($this->fieldtypeNameOptions) { + // We do some sanitation for filter + if (isset($this->fieldtypeNameOptions[0]) && !ComponentbuilderHelper::checkString($this->fieldtypeNameOptions[0]->value)) + { + unset($this->fieldtypeNameOptions[0]); + } // Fieldtype Name Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL').' -', @@ -234,6 +239,11 @@ class ComponentbuilderViewFields extends JViewLegacy $this->datatypeOptions = $this->getTheDatatypeSelections(); if ($this->datatypeOptions) { + // We do some sanitation for Datatype filter + if (isset($this->datatypeOptions[0]) && !ComponentbuilderHelper::checkString($this->datatypeOptions[0]->value)) + { + unset($this->datatypeOptions[0]); + } // Datatype Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL').' -', @@ -256,6 +266,11 @@ class ComponentbuilderViewFields extends JViewLegacy $this->indexesOptions = $this->getTheIndexesSelections(); if ($this->indexesOptions) { + // We do some sanitation for Indexes filter + if (isset($this->indexesOptions[0]) && !ComponentbuilderHelper::checkString($this->indexesOptions[0]->value)) + { + unset($this->indexesOptions[0]); + } // Indexes Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL').' -', @@ -278,6 +293,11 @@ class ComponentbuilderViewFields extends JViewLegacy $this->null_switchOptions = $this->getTheNull_switchSelections(); if ($this->null_switchOptions) { + // We do some sanitation for Null Switch filter + if (isset($this->null_switchOptions[0]) && !ComponentbuilderHelper::checkString($this->null_switchOptions[0]->value)) + { + unset($this->null_switchOptions[0]); + } // Null Switch Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL').' -', @@ -300,6 +320,11 @@ class ComponentbuilderViewFields extends JViewLegacy $this->storeOptions = $this->getTheStoreSelections(); if ($this->storeOptions) { + // We do some sanitation for Store filter + if (isset($this->storeOptions[0]) && !ComponentbuilderHelper::checkString($this->storeOptions[0]->value)) + { + unset($this->storeOptions[0]); + } // Store Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL').' -', diff --git a/admin/views/help_documents/view.html.php b/admin/views/help_documents/view.html.php index 51a425e54..5f93a83e5 100644 --- a/admin/views/help_documents/view.html.php +++ b/admin/views/help_documents/view.html.php @@ -190,6 +190,11 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy $this->typeOptions = $this->getTheTypeSelections(); if ($this->typeOptions) { + // We do some sanitation for Type filter + if (isset($this->typeOptions[0]) && !ComponentbuilderHelper::checkString($this->typeOptions[0]->value)) + { + unset($this->typeOptions[0]); + } // Type Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL').' -', @@ -212,6 +217,11 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy $this->locationOptions = $this->getTheLocationSelections(); if ($this->locationOptions) { + // We do some sanitation for Location filter + if (isset($this->locationOptions[0]) && !ComponentbuilderHelper::checkString($this->locationOptions[0]->value)) + { + unset($this->locationOptions[0]); + } // Location Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL').' -', @@ -234,6 +244,11 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy $this->admin_viewOptions = JFormHelper::loadFieldType('Adminviewfolderlist')->options; if ($this->admin_viewOptions) { + // We do some sanitation for Location filter + if (isset($this->admin_viewOptions[0]) && !ComponentbuilderHelper::checkString($this->admin_viewOptions[0]->value)) + { + unset($this->admin_viewOptions[0]); + } // Admin View Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -', @@ -256,6 +271,11 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy $this->site_viewOptions = JFormHelper::loadFieldType('Siteviewfolderlist')->options; if ($this->site_viewOptions) { + // We do some sanitation for Location filter + if (isset($this->site_viewOptions[0]) && !ComponentbuilderHelper::checkString($this->site_viewOptions[0]->value)) + { + unset($this->site_viewOptions[0]); + } // Site View Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL').' -', diff --git a/admin/views/joomla_components/view.html.php b/admin/views/joomla_components/view.html.php index 93cf071ec..f417b0619 100644 --- a/admin/views/joomla_components/view.html.php +++ b/admin/views/joomla_components/view.html.php @@ -220,6 +220,11 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy $this->companynameOptions = $this->getTheCompanynameSelections(); if ($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').' -', @@ -242,6 +247,11 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy $this->authorOptions = $this->getTheAuthorSelections(); if ($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').' -', diff --git a/admin/views/layouts/view.html.php b/admin/views/layouts/view.html.php index 60c57883f..b15874800 100644 --- a/admin/views/layouts/view.html.php +++ b/admin/views/layouts/view.html.php @@ -195,6 +195,11 @@ class ComponentbuilderViewLayouts extends JViewLegacy $this->dynamic_getNameOptions = JFormHelper::loadFieldType('Dynamicget')->options; if ($this->dynamic_getNameOptions) { + // We do some sanitation for filter + if (isset($this->dynamic_getNameOptions[0]) && !ComponentbuilderHelper::checkString($this->dynamic_getNameOptions[0]->value)) + { + unset($this->dynamic_getNameOptions[0]); + } // Dynamic Get Name Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_LAYOUT_DYNAMIC_GET_LABEL').' -', @@ -217,6 +222,11 @@ class ComponentbuilderViewLayouts extends JViewLegacy $this->add_php_viewOptions = $this->getTheAdd_php_viewSelections(); if ($this->add_php_viewOptions) { + // We do some sanitation for Add Php View filter + if (isset($this->add_php_viewOptions[0]) && !ComponentbuilderHelper::checkString($this->add_php_viewOptions[0]->value)) + { + unset($this->add_php_viewOptions[0]); + } // Add Php View Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_LAYOUT_ADD_PHP_VIEW_LABEL').' -', diff --git a/admin/views/libraries/view.html.php b/admin/views/libraries/view.html.php index c3f1e70fd..9a4d5fd39 100644 --- a/admin/views/libraries/view.html.php +++ b/admin/views/libraries/view.html.php @@ -185,6 +185,11 @@ class ComponentbuilderViewLibraries extends JViewLegacy $this->howOptions = JFormHelper::loadFieldType('Filebehaviour')->options; if ($this->howOptions) { + // We do some sanitation for filter + if (isset($this->howOptions[0]) && !ComponentbuilderHelper::checkString($this->howOptions[0]->value)) + { + unset($this->howOptions[0]); + } // How Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_LIBRARY_HOW_LABEL').' -', @@ -207,6 +212,11 @@ class ComponentbuilderViewLibraries extends JViewLegacy $this->typeOptions = $this->getTheTypeSelections(); if ($this->typeOptions) { + // We do some sanitation for Type filter + if (isset($this->typeOptions[0]) && !ComponentbuilderHelper::checkString($this->typeOptions[0]->value)) + { + unset($this->typeOptions[0]); + } // Type Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_LIBRARY_TYPE_LABEL').' -', diff --git a/admin/views/servers/view.html.php b/admin/views/servers/view.html.php index 809c5ec7b..005fa8a8c 100644 --- a/admin/views/servers/view.html.php +++ b/admin/views/servers/view.html.php @@ -190,6 +190,11 @@ class ComponentbuilderViewServers extends JViewLegacy $this->nameOptions = $this->getTheNameSelections(); if ($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').' -', @@ -212,6 +217,11 @@ class ComponentbuilderViewServers extends JViewLegacy $this->protocolOptions = $this->getTheProtocolSelections(); if ($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').' -', diff --git a/admin/views/site_views/view.html.php b/admin/views/site_views/view.html.php index f9227b938..f71087da6 100644 --- a/admin/views/site_views/view.html.php +++ b/admin/views/site_views/view.html.php @@ -195,6 +195,11 @@ class ComponentbuilderViewSite_views extends JViewLegacy $this->main_getNameOptions = JFormHelper::loadFieldType('Maingets')->options; if ($this->main_getNameOptions) { + // We do some sanitation for filter + if (isset($this->main_getNameOptions[0]) && !ComponentbuilderHelper::checkString($this->main_getNameOptions[0]->value)) + { + unset($this->main_getNameOptions[0]); + } // Main Get Name Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_SITE_VIEW_MAIN_GET_LABEL').' -', @@ -217,6 +222,11 @@ class ComponentbuilderViewSite_views extends JViewLegacy $this->add_php_ajaxOptions = $this->getTheAdd_php_ajaxSelections(); if ($this->add_php_ajaxOptions) { + // We do some sanitation for Add Php Ajax filter + if (isset($this->add_php_ajaxOptions[0]) && !ComponentbuilderHelper::checkString($this->add_php_ajaxOptions[0]->value)) + { + unset($this->add_php_ajaxOptions[0]); + } // Add Php Ajax Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_AJAX_LABEL').' -', @@ -239,6 +249,11 @@ class ComponentbuilderViewSite_views extends JViewLegacy $this->add_custom_buttonOptions = $this->getTheAdd_custom_buttonSelections(); if ($this->add_custom_buttonOptions) { + // We do some sanitation for Add Custom Button filter + if (isset($this->add_custom_buttonOptions[0]) && !ComponentbuilderHelper::checkString($this->add_custom_buttonOptions[0]->value)) + { + unset($this->add_custom_buttonOptions[0]); + } // Add Custom Button Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_SITE_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -', diff --git a/admin/views/snippets/view.html.php b/admin/views/snippets/view.html.php index 5cea48555..a85326ec8 100644 --- a/admin/views/snippets/view.html.php +++ b/admin/views/snippets/view.html.php @@ -200,6 +200,11 @@ class ComponentbuilderViewSnippets extends JViewLegacy $this->typeNameOptions = JFormHelper::loadFieldType('Snippettype')->options; if ($this->typeNameOptions) { + // We do some sanitation for filter + if (isset($this->typeNameOptions[0]) && !ComponentbuilderHelper::checkString($this->typeNameOptions[0]->value)) + { + unset($this->typeNameOptions[0]); + } // Type Name Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_SNIPPET_TYPE_LABEL').' -', @@ -222,6 +227,11 @@ class ComponentbuilderViewSnippets extends JViewLegacy $this->libraryNameOptions = JFormHelper::loadFieldType('Library')->options; if ($this->libraryNameOptions) { + // We do some sanitation for filter + if (isset($this->libraryNameOptions[0]) && !ComponentbuilderHelper::checkString($this->libraryNameOptions[0]->value)) + { + unset($this->libraryNameOptions[0]); + } // Library Name Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_SNIPPET_LIBRARY_LABEL').' -', diff --git a/admin/views/templates/view.html.php b/admin/views/templates/view.html.php index d77add504..09651d2d3 100644 --- a/admin/views/templates/view.html.php +++ b/admin/views/templates/view.html.php @@ -195,6 +195,11 @@ class ComponentbuilderViewTemplates extends JViewLegacy $this->dynamic_getNameOptions = JFormHelper::loadFieldType('Dynamicget')->options; if ($this->dynamic_getNameOptions) { + // We do some sanitation for filter + if (isset($this->dynamic_getNameOptions[0]) && !ComponentbuilderHelper::checkString($this->dynamic_getNameOptions[0]->value)) + { + unset($this->dynamic_getNameOptions[0]); + } // Dynamic Get Name Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_TEMPLATE_DYNAMIC_GET_LABEL').' -', @@ -217,6 +222,11 @@ class ComponentbuilderViewTemplates extends JViewLegacy $this->add_php_viewOptions = $this->getTheAdd_php_viewSelections(); if ($this->add_php_viewOptions) { + // We do some sanitation for Add Php View filter + if (isset($this->add_php_viewOptions[0]) && !ComponentbuilderHelper::checkString($this->add_php_viewOptions[0]->value)) + { + unset($this->add_php_viewOptions[0]); + } // Add Php View Filter JHtmlSidebar::addFilter( '- Select '.JText::_('COM_COMPONENTBUILDER_TEMPLATE_ADD_PHP_VIEW_LABEL').' -',