Skip to content

Commit 064e53d

Browse files
committed
Some more migrations
Tribute to capkokoon
1 parent 5969c68 commit 064e53d

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎featherbb/Model/Post.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ public function insert_report($post_id)
548548
throw new Error(__('Reason too long'), 400);
549549
}
550550

551-
if (User::get()->last_report_sent != '' && (time() - User::get()->last_report_sent) < User::get()->g_report_flood && (time() - User::get()->last_report_sent) >= 0) {
552-
throw new Error(sprintf(__('Report flood'), User::get()->g_report_flood, User::get()->g_report_flood - (time() - User::get()->last_report_sent)), 429);
551+
if (User::get()->last_report_sent != '' && (time() - User::get()->last_report_sent) < Container::get('prefs')->get(User::get(), 'report.min_interval') && (time() - User::get()->last_report_sent) >= 0) {
552+
throw new Error(sprintf(__('Report flood'), Container::get('prefs')->get(User::get(), 'report.min_interval'), Container::get('prefs')->get(User::get(), 'report.min_interval') - (time() - User::get()->last_report_sent)), 429);
553553
}
554554

555555
// Get the topic ID

‎featherbb/Model/Profile.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,8 +1321,8 @@ public function send_email($mail)
13211321
throw new Error(__('Too long email message'), 400);
13221322
}
13231323

1324-
if (User::get()->last_email_sent != '' && (time() - User::get()->last_email_sent) < User::get()->g_email_flood && (time() - User::get()->last_email_sent) >= 0) {
1325-
throw new Error(sprintf(__('Email flood'), User::get()->g_email_flood, User::get()->g_email_flood - (time() - User::get()->last_email_sent)), 429);
1324+
if (User::get()->last_email_sent != '' && (time() - User::get()->last_email_sent) < Container::get('prefs')->get(User::get(), 'email.min_interval') && (time() - User::get()->last_email_sent) >= 0) {
1325+
throw new Error(sprintf(__('Email flood'), Container::get('prefs')->get(User::get(), 'email.min_interval'), Container::get('prefs')->get(User::get(), 'email.min_interval') - (time() - User::get()->last_email_sent)), 429);
13261326
}
13271327

13281328
// Load the "form email" template

‎featherbb/Model/Search.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ public function get_search_results()
128128

129129
if (!empty($author) || !empty($keywords)) {
130130
// Flood protection
131-
if (User::get()->last_search && (time() - User::get()->last_search) < User::get()->g_search_flood && (time() - User::get()->last_search) >= 0) {
132-
throw new Error(sprintf(__('Search flood'), User::get()->g_search_flood, User::get()->g_search_flood - (time() - User::get()->last_search)), 429);
131+
if (User::get()->last_search && (time() - User::get()->last_search) < Container::get('prefs')->get(User::get(), 'search.min_interval') && (time() - User::get()->last_search) >= 0) {
132+
throw new Error(sprintf(__('Search flood'), Container::get('prefs')->get(User::get(), 'search.min_interval'), Container::get('prefs')->get(User::get(), 'search.min_interval') - (time() - User::get()->last_search)), 429);
133133
}
134134

135135
if (!User::get()->is_guest) {

0 commit comments

Comments
 (0)