Skip to content

Commit 067902f

Browse files
committed
fix(targetticket): prevent SQL error
1 parent 7620249 commit 067902f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

inc/targetticket.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ protected function setTargetLocation($data, $formanswer) {
964964
'plugin_formcreator_questions_id' => $this->fields['location_question']
965965
]
966966
])->current();
967-
if (ctype_digit($location['answer'])) {
967+
if (isset($location['answer']) && ctype_digit($location['answer'])) {
968968
$location = $location['answer'];
969969
}
970970
break;
@@ -993,13 +993,13 @@ protected function setTargetType(array $data, PluginFormcreatorFormAnswer $forma
993993
'plugin_formcreator_questions_id' => $this->fields['type_question']
994994
]
995995
])->current();
996-
$type = $type['answer'];
996+
if (isset($type['answer']) && ctype_digit($type['answer'])) {
997+
$type = $type['answer'];
998+
}
997999
break;
9981000
case self::REQUESTTYPE_SPECIFIC:
9991001
$type = $this->fields['type_question'];
10001002
break;
1001-
default:
1002-
$type = null;
10031003
}
10041004
if (!is_null($type)) {
10051005
$data['type'] = $type;

0 commit comments

Comments
 (0)