mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Vulnerability closed , now you cannot send more then 5 message / minute at same user
This commit is contained in:
+23
-2
@@ -317,10 +317,20 @@ class Message {
|
||||
|
||||
private function sendAMessage($topic,$text) {
|
||||
global $session,$database;
|
||||
|
||||
// Vulnerability closed by Shadow
|
||||
|
||||
$q = "SELECT * FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".time()." - 60";
|
||||
$res = mysql_query($q) or die(mysql_error(). " query ".$q);
|
||||
$flood = mysql_num_rows($res);
|
||||
if($flood > 5)
|
||||
return; //flood
|
||||
|
||||
// Vulnerability closed by Shadow
|
||||
|
||||
$allmembersQ = mysql_query("SELECT id FROM ".TB_PREFIX."users WHERE alliance='".$session->alliance."'");
|
||||
$userally = $database->getUserField($session->uid,"alliance",0);
|
||||
$permission=mysql_fetch_array(mysql_query("SELECT opt7 FROM ".TB_PREFIX."ali_permission WHERE uid='".$session->uid."'"));
|
||||
|
||||
if(WORD_CENSOR) {
|
||||
$topic = $this->wordCensor($topic);
|
||||
$text = $this->wordCensor($text);
|
||||
@@ -396,6 +406,17 @@ class Message {
|
||||
private function sendMessage($recieve, $topic, $text) {
|
||||
global $session, $database;
|
||||
$user = $database->getUserField($recieve, "id", 1);
|
||||
|
||||
// Vulnerability closed by Shadow
|
||||
|
||||
$q = "SELECT * FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".time()." - 60";
|
||||
$res = mysql_query($q) or die(mysql_error(). " query ".$q);
|
||||
$flood = mysql_num_rows($res);
|
||||
if($flood > 5)
|
||||
return; //flood
|
||||
|
||||
// Vulnerability closed by Shadow
|
||||
|
||||
if(WORD_CENSOR) {
|
||||
$topic = $this->wordCensor($topic);
|
||||
$text = $this->wordCensor($text);
|
||||
@@ -478,7 +499,7 @@ class Message {
|
||||
$welcomemsg = preg_replace("'%ALLI%'", $database->countAlli(), $welcomemsg);
|
||||
$welcomemsg = preg_replace("'%SERVER_NAME%'", SERVER_NAME, $welcomemsg);
|
||||
$welcomemsg = "[message]".$welcomemsg."[/message]";
|
||||
return $database->sendMessage($uid, 5, WEL_TOPIC, addslashes($welcomemsg), 0, 0, 0, 0, 0);
|
||||
return $database->sendMessage($uid, 1, WEL_TOPIC, addslashes($welcomemsg), 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
private function wordCensor($text) {
|
||||
|
||||
Reference in New Issue
Block a user