original_string: private function isLocalIp ()
      {
          $ip = $this->serverData["REMOTE_ADDR"];
  
          if (!is_string($ip))
          {
              return false;
          }
  
          if (in_array($ip, ['127.0.0.1', 'fe80::1', '::1'], true))
          {
              return true;
          }
  
          // allowed (= local) IPs include
          // 10.0.0.0 – 10.255.255.255
          // 172.16.0.0 – 172.31.255.255
          // 192.168.0.0 – 192.168.255.255
          return 1 === preg_match("/^(10\\.|192\\.168\\.|172\\.(1[6-9]|2[0-9]|3[0-1])\\.)/", $ip);
      }
code: private function isLocalIp ()
      {
          $ip = $this->serverData["REMOTE_ADDR"];
  
          if (!is_string($ip))
          {
              return false;
          }
  
          if (in_array($ip, ['127.0.0.1', 'fe80::1', '::1'], true))
          {
              return true;
          }
  
          // allowed (= local) IPs include
          // 10.0.0.0 – 10.255.255.255
          // 172.16.0.0 – 172.31.255.255
          // 192.168.0.0 – 192.168.255.255
          return 1 === preg_match("/^(10\\.|192\\.168\\.|172\\.(1[6-9]|2[0-9]|3[0-1])\\.)/", $ip);
      }
code_tokens: private function isLocalIp ( ) { $ ip = $ this -> serverData [ "REMOTE_ADDR" ] ; if ( ! is_string ( $ ip ) ) { return false ; } if ( in_array ( $ ip , [ '127.0.0.1' , 'fe80::1' , '::1' ] , true ) ) { return true ; } // allowed (= local) IPs include // 10.0.0.0 – 10.255.255.255 // 172.16.0.0 – 172.31.255.255 // 192.168.0.0 – 192.168.255.255 return 1 === preg_match ( "/^(10\\.|192\\.168\\.|172\\.(1[6-9]|2[0-9]|3[0-1])\\.)/" , $ ip ) ; }
docstring: Returns whether remote IP is a local one
  
  @return bool
docstring_tokens: Returns whether remote IP is a local one