• Resolved theegrafter

    (@theegrafter)


    Hi there,

    I currently have WPScan installed on a clients website and the report shows that the debug log file is showing a PHP notice when I open it.

    PHP Notice: Undefined index: HTTP_HOST in /www/public_html/wp-content/plugins/headers-security-advanced-hsts-wp/headers-security-advanced-hsts-wp.php on line 131

    This is the section of code where this error is flagged:

    }
    add_filter( 'wp_headers', 'Headers_Security_Advanced_HSTS_WP_Headers' );
    
    // check HTTPS - preload list HSTS
    if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] !== 'on') { 
      if(!headers_sent()) {
          header("Status: 301 Moved Permanently");
          header(sprintf(
              'Location: https://%s%s',
              $_SERVER['HTTP_HOST'],
              $_SERVER['REQUEST_URI']
          ));
          exit();
      }

    I am not a coder or developer so unsure if this is something to worry about. Any advice or insight would be greatly appreciated.

    Thanks

    Paul

Viewing 1 replies (of 1 total)
  • Plugin Author Andrea Ferro

    (@unicorn03)

    Hello @theegrafter, thank you for installing Headers Security Advanced & HSTS WP.

    Thank you very much for the issue and we are happy for your feedback.

    After a verification I can guarantee you that you don’t have to worry about the warning of the undefined variable, but it will be solved with the update of this afternoon we want to ensure an effective but above all optimized plugin.

    For any question do not hesitate to contact us

Viewing 1 replies (of 1 total)
  • The topic ‘WPScan shows PHP Notice: Undefined index: HTTP_HOST in debug log file’ is closed to new replies.