[Web] Delete log lines containing ratelimit hash key when removing rate limit hashes from db
This commit is contained in:
		
							parent
							
								
									a66b7eeb19
								
							
						
					
					
						commit
						92df42999e
					
				@ -203,7 +203,15 @@ function ratelimit($_action, $_scope, $_data = null) {
 | 
			
		||||
        return false;
 | 
			
		||||
      }
 | 
			
		||||
      try {
 | 
			
		||||
        if ($redis->exists($data['hash'])) {
 | 
			
		||||
        $data_rllog = $redis->lRange('RL_LOG', 0, -1);
 | 
			
		||||
        if ($data_rllog) {
 | 
			
		||||
          foreach ($data_rllog as $json_line) {
 | 
			
		||||
            if (preg_match('/' . $data['hash'] . '/i', $json_line)) {
 | 
			
		||||
              $redis->lRem('RL_LOG', $json_line, 0);
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        if ($redis->type($data['hash']) == Redis::REDIS_HASH) {
 | 
			
		||||
          $redis->delete($data['hash']);
 | 
			
		||||
          $_SESSION['return'][] = array(
 | 
			
		||||
            'type' => 'success',
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user