Skip to content

Commit d06d677

Browse files
committed
fix torrent edit and send email
1 parent 9de6fb4 commit d06d677

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

app/Repositories/ToolRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ public function sendMail($to, $subject, $body, $exception = false): bool
329329
}
330330
// Create the Transport
331331
$transport = $factory->create(new Dsn(
332-
$encryption === 'tls' ? (($smtp['smtpport'] == 465) ? 'smtps' : 'smtp') : '',
332+
// $encryption === 'tls' ? (($smtp['smtpport'] == 465) ? 'smtps' : 'smtp') : '',
333+
$smtp['smtpport'] == 465 && in_array($encryption, ['ssl', 'tls']) ? 'smtps' : 'smtp',
333334
$smtp['smtpaddress'],
334335
$smtp['accountname'] ?? null,
335336
$smtp['accountpassword'] ?? null,

public/edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
if (!$id)
99
die();
1010

11-
$res = sql_query("SELECT torrents.*, categories.mode as cat_mode FROM torrents LEFT JOIN categories ON category = categories.id WHERE torrents.id = $id");
11+
$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");
1212
$row = mysql_fetch_assoc($res);
1313
if (!$row) die();
1414

public/mailtest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
$toolRep->sendMail($email, $title, $body, true);
2727
stderr($lang_mailtest['std_success'], $lang_mailtest['std_success_note']);
2828
} catch (\Throwable $e) {
29+
do_log($e->getMessage().$e->getTraceAsString(), "error");
2930
stderr($lang_functions['std_error'], $lang_functions['text_unable_to_send_mail'] . sprintf("<br/><br/><code>%s</code>", $e->getMessage()), false);
3031
}
3132
}

0 commit comments

Comments
 (0)