add try catch to handle invalid value

This commit is contained in:
iBNu Maksum 2024-10-17 13:38:50 +07:00
parent 97296abf06
commit 234e5e3967
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
2 changed files with 21 additions and 5 deletions

View File

@ -333,10 +333,25 @@ $unpaid = ORM::for_table('tbl_payment_gateway')
->find_one();
// check expired payments
if($unpaid && (strtotime($unpaid['expired_date']) < time() || strtotime($unpaid['created_date'], "+24 HOUR") < time())){
$unpaid->status = 4;
$unpaid->save();
$unpaid = [];
if ($unpaid) {
try {
if (strtotime($unpaid['expired_date']) < time()) {
$unpaid->status = 4;
$unpaid->save();
$unpaid = [];
}
} catch (Throwable $e) {
} catch (Exception $e) {
}
try {
if (strtotime($unpaid['created_date'], "+24 HOUR") < time()) {
$unpaid->status = 4;
$unpaid->save();
$unpaid = [];
}
} catch (Throwable $e) {
} catch (Exception $e) {
}
}
$ui->assign('unpaid', $unpaids);

View File

@ -846,5 +846,6 @@
"If_you_just_update_PHPNuxBill_from_upload_files__try_click_Update": "If you just update PHPNuxBill from upload files, try click Update",
"Update_PHPNuxBill": "Update PHPNuxBill",
"Ask_Github_Community": "Ask Github Community",
"Ask_Telegram_Community": "Ask Telegram Community"
"Ask_Telegram_Community": "Ask Telegram Community",
"Transaction_History_List": "Transaction History List"
}