Skip to content

Commit

Permalink
Fix array access with unknown key (see #27)
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffparnitzky committed Sep 5, 2023
1 parent 0c1d202 commit cf8244d
Showing 1 changed file with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* Contao Open Source CMS
* Copyright (C) 2005-2021
* Copyright (C) 2005-2023
*
* Formerly known as TYPOlight Open Source CMS.
*
Expand All @@ -21,7 +21,7 @@
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright Cliff Parnitzky 2012-2022
* @copyright Cliff Parnitzky 2012-2023
* @author Cliff Parnitzky
* @package FormDependentMandatoryField
* @license LGPL
Expand All @@ -30,7 +30,7 @@
/**
* Class FormDependentMandatoryField
*
* @copyright Cliff Parnitzky 2012-2022
* @copyright Cliff Parnitzky 2012-2023
* @author Cliff Parnitzky
*/
class FormDependentMandatoryField extends Backend {
Expand Down Expand Up @@ -296,18 +296,21 @@ private function isFormFileUpload ($fieldName, $formId) {
*/
public static function isFormFieldSubmittable($strWidgetName)
{
$strWidgetClass = $GLOBALS['TL_FFL'][$strWidgetName];
if (!empty($strWidgetClass))
if (array_key_exists($strWidgetName, $GLOBALS['TL_FFL']))
{
$objWidget = new $strWidgetClass();
if ($objWidget)
$strWidgetClass = $GLOBALS['TL_FFL'][$strWidgetName];
if (!empty($strWidgetClass))
{
if ($strWidgetName == 'upload')
$objWidget = new $strWidgetClass();
if ($objWidget)
{
// this field is not submittable but should also be usable.
return true;
if ($strWidgetName == 'upload')
{
// this field is not submittable but should also be usable.
return true;
}
return $objWidget->submitInput();
}
return $objWidget->submitInput();
}
}
return false;
Expand Down

0 comments on commit cf8244d

Please sign in to comment.