fix: add fallback value for setting variables
This commit is contained in:
10
dropmail.php
10
dropmail.php
@@ -3,7 +3,7 @@
|
||||
// 1. Bootstrap Laravel
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
|
||||
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||
$app = require __DIR__.'/bootstrap/app.php';
|
||||
|
||||
// 2. Start Laravel container
|
||||
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
|
||||
@@ -14,12 +14,12 @@ set_time_limit(0);
|
||||
$newTimezone = 'Europe/London';
|
||||
date_default_timezone_set($newTimezone);
|
||||
|
||||
$imapDB = json_decode(config('app.settings.imap_settings'), true);
|
||||
$imapDB = json_decode(config('app.settings.imap_settings') ?: '{}', true);
|
||||
|
||||
// Mailbox credentials
|
||||
$hostname = '{'.$imapDB['host'].':'.$imapDB['port'].'/ssl}INBOX';
|
||||
$username = $imapDB['username'];
|
||||
$password = $imapDB['password'];
|
||||
$hostname = '{'.($imapDB['host'] ?? 'localhost').':'.($imapDB['port'] ?? '993').'/ssl}INBOX';
|
||||
$username = $imapDB['username'] ?? '';
|
||||
$password = $imapDB['password'] ?? '';
|
||||
|
||||
// Connect to mailbox
|
||||
$inbox = imap_open($hostname, $username, $password);
|
||||
|
||||
Reference in New Issue
Block a user