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