X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fsecurity.inc.php;h=d978e5df2c9de97fbb1706f59cc71ea4b5a4607e;hb=b80cbf0db8e7ac7e11ea2bb49bbf3efd79f4fadf;hp=cb3cba5700da8c6e90ce5270753f73366e71c470;hpb=12262f1306059765d8625a6752364679c8625d31;p=platal.git diff --git a/include/security.inc.php b/include/security.inc.php index cb3cba5..d978e5d 100644 --- a/include/security.inc.php +++ b/include/security.inc.php @@ -66,10 +66,11 @@ function check_ip($level) function check_email($email, $message) { - $res = XDB::query("SELECT state, description - FROM email_watch - WHERE state != 'safe' AND email = {?}", $email); - if ($res->numRows()) { + $res = XDB::fetchOneCell('SELECT COUNT(*) + FROM email_watch + WHERE state != \'safe\' AND email = {?}', + $email); + if ($res) { send_warning_mail($message); return true; }