You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// @TODO: is this even logical to perform this check?
591
+
if (isset($data[$variable->env_variable]) && empty($data[$variable->env_variable])) {
592
+
if ($variable->required === 1) {
593
+
thrownewDisplayException('A required service option variable field (' . $variable->env_variable . ') was included in this request but was left blank.');
594
+
}
595
+
}
596
+
597
+
// Variable hidden and/or not user editable
598
+
if ($variable->user_viewable === 0 || $variable->user_editable === 0) {
599
+
thrownewDisplayException('A service option variable field (' . $variable->env_variable . ') does not exist or you do not have permission to edit it.');
600
+
}
601
+
602
+
// Check aganist Regex Pattern
603
+
if (!is_null($variable->regex) && !preg_match($variable->regex, $data[$variable->env_variable])) {
604
+
thrownewDisplayException('Failed to validate service option variable field (' . $variable->env_variable . ') aganist regex (' . $variable->regex . ').');
605
+
}
573
606
574
-
// Update Empty but skip validation
575
-
if (empty($data[$variable->env_variable])) {
576
607
$variableList = array_merge($variableList, [[
577
608
'id' => $variable->id,
578
609
'env' => $variable->env_variable,
579
-
'val' => null
610
+
'val' => $data[$variable->env_variable]
580
611
]]);
581
-
continue;
582
-
}
583
-
584
-
// Is the variable required?
585
-
// @TODO: is this even logical to perform this check?
586
-
if (isset($data[$variable->env_variable]) && empty($data[$variable->env_variable])) {
587
-
if ($variable->required === 1) {
588
-
thrownewDisplayException('A required service option variable field (' . $variable->env_variable . ') was included in this request but was left blank.');
589
-
}
590
612
}
591
-
592
-
// Check aganist Regex Pattern
593
-
if (!is_null($variable->regex) && !preg_match($variable->regex, $data[$variable->env_variable])) {
594
-
thrownewDisplayException('Failed to validate service option variable field (' . $variable->env_variable . ') aganist regex (' . $variable->regex . ').');
0 commit comments