Skip to content

Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.

Fixed undefined variable error on saving SMTP settings

Ameer Dawoodb156c2211d9f
diff --git a/endpoints/admin/savesmtpsettings.php b/endpoints/admin/savesmtpsettings.php
index 130f2c0..4b01e61 100644
--- a/endpoints/admin/savesmtpsettings.php
+++ b/endpoints/admin/savesmtpsettings.php
@@ -21,6 +21,7 @@ if (empty($smtpAddress) || empty($smtpPort)) {
]));
}
+$smtpPortInt = (int) $smtpPort;
if (!validate_smtp_host($smtpAddress, $smtpPortInt, $db)) {
die(json_encode([
"success" => false,
@@ -28,7 +29,6 @@ if (!validate_smtp_host($smtpAddress, $smtpPortInt, $db)) {
]));
}
-$smtpPortInt = (int) $smtpPort;
if ($smtpPortInt < 1 || $smtpPortInt > 65535) {
die(json_encode([
"success" => false,
@@ -57,4 +57,4 @@ if ($result) {
"success" => false,
"message" => translate('error', $i18n)
]));
-}
\ No newline at end of file
+}