- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
public function sendChat ($msg) {
if($this->isLogged()){
if($this->checkAd($this->sql($msg)) !== '' || $this->checkAd($this->sql($msg))[0] !== ' '){
$q = $this->db->row("SELECT * FROM `chat` WHERE `user` = '".intval($_SESSION['steamid'])."' ORDER BY `id` DESC LIMIT 1");
if($q->time+1 <= time()){
if($q->text != $this->checkAd($this->sql($msg))) {
$r = $this->db->query("INSERT INTO `chat` (`user`,`text`,`time`) VALUES ('".intval($_SESSION['steamid'])."', '".$this->sql($this->checkAd($msg))."', ".time().")");
return json_encode(array("success" => true,));
} else {
return json_encode(array("success" => false, "msg" => "flood"));
}
} else {
return json_encode(array("success" => false, "msg" => "flood"));
}
} else {
json_encode(array("success" => false, "msg" => "null_msg"));
}
} else {
return json_encode(array("success" => false, "msg" => "not_auth"));
}
}
artofwake 13.12.2017 14:32 # −1
Проверок не хватает.
Жестко, конечно.
COWuTEJIbTBOEuMAMKu 13.12.2017 15:19 # 0
KaBauHblu_nemyx 10.07.2019 08:33 # 0