X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fsecurity.inc.php;fp=include%2Fsecurity.inc.php;h=d978e5df2c9de97fbb1706f59cc71ea4b5a4607e;hb=b45037625befabbc6a25ab0487321d8b77f62fa4;hp=cb3cba5700da8c6e90ce5270753f73366e71c470;hpb=67f95129c935e3844b9ecf996bb29f979ef3ca7f;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; }