Skip to content

Commit

Permalink
fix torrent edit and send email
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Jan 19, 2025
1 parent 9de6fb4 commit d06d677
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/Repositories/ToolRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ public function sendMail($to, $subject, $body, $exception = false): bool
}
// Create the Transport
$transport = $factory->create(new Dsn(
$encryption === 'tls' ? (($smtp['smtpport'] == 465) ? 'smtps' : 'smtp') : '',
// $encryption === 'tls' ? (($smtp['smtpport'] == 465) ? 'smtps' : 'smtp') : '',
$smtp['smtpport'] == 465 && in_array($encryption, ['ssl', 'tls']) ? 'smtps' : 'smtp',
$smtp['smtpaddress'],
$smtp['accountname'] ?? null,
$smtp['accountpassword'] ?? null,
Expand Down
2 changes: 1 addition & 1 deletion public/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if (!$id)
die();

$res = sql_query("SELECT torrents.*, categories.mode as cat_mode FROM torrents LEFT JOIN categories ON category = categories.id WHERE torrents.id = $id");
$res = sql_query("SELECT torrents.*, categories.mode as cat_mode, torrent_extras.media_info as technical_info, torrent_extras.descr FROM torrents LEFT JOIN categories ON category = categories.id left join torrent_extras on torrents.id = torrent_extras.torrent_id WHERE torrents.id = $id");
$row = mysql_fetch_assoc($res);
if (!$row) die();

Expand Down
1 change: 1 addition & 0 deletions public/mailtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
$toolRep->sendMail($email, $title, $body, true);
stderr($lang_mailtest['std_success'], $lang_mailtest['std_success_note']);
} catch (\Throwable $e) {
do_log($e->getMessage().$e->getTraceAsString(), "error");
stderr($lang_functions['std_error'], $lang_functions['text_unable_to_send_mail'] . sprintf("<br/><br/><code>%s</code>", $e->getMessage()), false);
}
}
Expand Down

0 comments on commit d06d677

Please sign in to comment.