Support » Plugin: Password Protected » Possible Undefined index: redirect_to

  • Resolved KittMedia

    (@kittmedia)


    It may be possible that there is no $_REQUEST['redirect_to'] but that doesn’t get checked in line 134 of the file password-protected/theme/password-protected-login.php. This leads to a PHP notice for an undefined index: redirect_to and should be fixed.

    The complete stack:

    
    ErrorException: Notice: Undefined index: redirect_to
    #8 /wp-content/plugins/password-protected/theme/password-protected-login.php(134): require_once
    #7 /wp-includes/template.php(723): load_template
    #6 /wp-content/plugins/password-protected/password-protected.php(374): Password_Protected::maybe_show_login
    #5 /wp-includes/class-wp-hook.php(287): WP_Hook::apply_filters
    #4 /wp-includes/class-wp-hook.php(311): WP_Hook::do_action
    #3 /wp-includes/plugin.php(478): do_action
    #2 /wp-includes/template-loader.php(13): require_once
    #1 /wp-blog-header.php(19): require
    #0 /index.php(17): null
    
Viewing 5 replies - 1 through 5 (of 5 total)
  • Joelle

    (@joelle)

    It may be possible that there is no $_REQUEST[‘redirect_to’] but that doesn’t get checked in line 134 of the file password-protected/theme/password-protected-login.php. This leads to a PHP notice for an undefined index: redirect_to and should be fixed.

    Since this plugin, as great as it is, hasn’t been updated in 3 years, I’m going to guess this hasn’t been addressed. Do you happen to know how to fix this? I’m willing to hack the plugin at this point, given that it’s not being updated any longer. Thank you!

    Thread Starter KittMedia

    (@kittmedia)

    hasn’t been updated in 3 years

    Where did you get this information from? At least the current version 2.3 is 4 months old, not 3 years.

    To fix it, you would need to change line 134 in the above mentioned line to this:
    <input type="hidden" name="redirect_to" value="<?php echo esc_attr( ( ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' ) ); ?>" />

    Joelle

    (@joelle)

    You know, I have no idea why I thought that, I’m sorry! I must’ve been looking at the wrong tab. But it wasn’t intended to be snide, my bad.

    Anyway! Thank you for responding, I will give this a go. 🙂

    That worked great, thank you so much. 🙂

    Plugin Author Ben Huson

    (@husobj)

    This will be fixed in the next release of the plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Possible Undefined index: redirect_to’ is closed to new replies.