• Resolved caribouweb

    (@caribouweb)


    Hi,

    In the file /wp-content/plugins/eps-301-redirects/eps-301-redirects.php, line 969:

    $last['user_agent'] = @strip_tags($_SERVER['HTTP_USER_AGENT']);

    it displays two warnings in the log file when HTTP_USER_AGENT is undefined:

    PHP Error: [2] Undefined array key "HTTP_USER_AGENT" in /wp-content/plugins/eps-301-redirects/eps-301-redirects.php on line 969
    Stack trace:
    #0 /wp-content/plugins/eps-301-redirects/eps-301-redirects.php(969): custom_error_handler(integer, string, string, integer)
    #1 /wp-includes/class-wp-hook.php(324): EPS_Redirects->check_404(string)
    #2 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(boolean, array)
    #3 /wp-includes/plugin.php(517): WP_Hook->do_action(array)
    #4 /wp-includes/template-loader.php(13): do_action(string)
    #5 /wp-blog-header.php(19): require_once(string)
    #6 /index.php(17): require(string)

    PHP Error: [8192] strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /wp-content/plugins/eps-301-redirects/eps-301-redirects.php on line 969
    Stack trace:
    #1 /wp-content/plugins/eps-301-redirects/eps-301-redirects.php(969): strip_tags(NULL)
    #2 /wp-includes/class-wp-hook.php(324): EPS_Redirects->check_404(string)
    #3 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(boolean, array)
    #4 /wp-includes/plugin.php(517): WP_Hook->do_action(array)
    #5 /wp-includes/template-loader.php(13): do_action(string)
    #6 /wp-blog-header.php(19): require_once(string)
    #7 /index.php(17): require(string)

    I’m using 301 Redirects v2.76, WordPress 6.5.5 and PHP 8.1.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Manage the case where `$_SERVER[‘HTTP_USER_AGENT’]` is undefined’ is closed to new replies.