Skip to content

Commit

Permalink
fix(targetticket): prevent setting a type from an incompatible question
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jun 24, 2022
1 parent b172ba8 commit f5de8bb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions inc/targetticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,13 @@ protected function setTargetType(array $data, PluginFormcreatorFormAnswer $forma
])->current();
if (isset($type['answer']) && ctype_digit($type['answer'])) {
$type = $type['answer'];
} else {
// Invalid value. Maybe the questin is not compatible.
trigger_error(sprintf("Attempt to set the type of a ticket from an incompatible question. Check the target ticket %s of the form ID=%s",
$this->fields['name'],
$this->getForm()->getID()
));
$type = null;
}
break;
case self::REQUESTTYPE_SPECIFIC:
Expand Down

0 comments on commit f5de8bb

Please sign in to comment.