From 2b2a8dca5f3b1ec6fc5752634acedc148fc49663 Mon Sep 17 00:00:00 2001 From: 8chan Date: Fri, 5 Jun 2015 03:08:28 -0700 Subject: [PATCH] Bugfix for new PMs --- inc/mod/pages.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 63c9188f..48864297 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -2325,8 +2325,9 @@ function mod_new_pm($username) { if ($row['boards'] === '*') { // If the global user PM'd them first within the last month, they can reply. - $check = prepare('SELECT * FROM ``pms`` WHERE FROM_UNIXTIME(`time`) < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND `to` = :to'); - $check->bindValue(':to', $row['id']); + $check = prepare('SELECT * FROM ``pms`` WHERE FROM_UNIXTIME(`time`) > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND `sender` = :sender AND `to` = :to'); + $check->bindValue(':sender', $row['id']); + $check->bindValue(':to', $mod['id']); $check->execute() or error(db_error($check)); if (!$check->rowCount()) { error(_('You may not PM a member of global staff who did not PM you within the last month. Try posting on /operate/ or emailing us instead: admin@8chan.co'));