propperly check return value of setApprovalByXX

This commit is contained in:
Uwe Steinmann 2021-09-29 17:25:24 +02:00
parent 7e17ea145c
commit 7aaa02cf7d

View File

@ -96,7 +96,7 @@ if ($_POST["approvalType"] == "ind") {
else
$file = '';
$approvalLogID = $latestContent->setApprovalByInd($user, $user, $_POST["approvalStatus"], $comment, $file);
if(0 > $approvalLogID) {
if($approvalLogID === false || 0 > $approvalLogID) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("approval_update_failed"));
}
else {
@ -115,7 +115,7 @@ else if ($_POST["approvalType"] == "grp") {
else
$file = '';
$approvalLogID = $latestContent->setApprovalByGrp($group, $user, $_POST["approvalStatus"], $comment, $file);
if(0 > $approvalLogID) {
if($approvalLogID === false || 0 > $approvalLogID) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("approval_update_failed"));
}
else {