invis.net

Remove now-unnecessary PHP version check

The xmlrpc_log() function includes a version_compare() check to toggle between using php://input or $HTTP_RAW_POST_DATA (the latter of which was deprecated in PHP 5.6 and removed in 7.0), but since the plugin requires PHP 5.6 or newer this conditional can safely be dropped:

# feature/xmlrpc.php
  function xmlrpc_log()
  {
      if (false === ($fp = fopen(WP_FAIL2BAN_XMLRPC_LOG, 'a+'))) {
          // TODO: decided whether to log this
      } else {
-         $raw_data = (version_compare(PHP_VERSION, '7.0.0') >= 0)
-             ? file_get_contents('php://input')
-             : $HTTP_RAW_POST_DATA;
+         $raw_data = file_get_contents('php://input');
  
          fprintf($fp, "# ---\n# Date: %s\n# IP: %s\n\n%s\n", date(DATE_ATOM), remote_addr(), $raw_data);
          fclose($fp);
      }
  }

You’re quite right - I’ll drop that in the next release. Thanks!