WordPress.org

Ready to get started?Download WordPress

Forums

Simple Google Connect
[resolved] Patch: fix WP_DEBUG notice for sgc_login_disconnect (2 posts)

  1. markmont
    Member
    Posted 1 year ago #

    When define('WP_DEBUG', true) is set in wp-config.php, the following notice is displayed by Simple Google Connect for every page:

    [25-Sep-2012 14:18:09 UTC] PHP Notice: Undefined index: sgc_login_disconnect in /www/wp1/wordpress/wp-content/plugins/simple-google-connect/sgc-login.php on line 97

    Here is a patch that removed the notice and also ensures that users can't disconnect their account if the admin has disallowed this:

    diff -up simple-google-connect/sgc-login.php.nowarn simple-google-connect/sgc-login.php
    --- simple-google-connect/sgc-login.php.nowarn  2012-09-25 14:29:08.963299799 +0000
    +++ simple-google-connect/sgc-login.php 2012-09-25 14:32:21.709734342 +0000
    @@ -94,7 +94,7 @@ exit;
     add_action('init','sgc_login_check_disconnect');
    
     function sgc_login_check_disconnect() {
    -       if ( $_GET['sgc_login_disconnect'] == 1 ) {
    +       if ( SGC_ALLOW_DISCONNECT && isset($_GET['sgc_login_disconnect']) && $_GET['sgc_login_disconnect'] == 1 ) {
                    check_admin_referer( 'sgc_login_disconnect' );
                    sgc_login_disconnect_user();
                    wp_safe_redirect(get_edit_profile_url($profile->ID));

    Many thanks for providing this great plugin!

    http://wordpress.org/extend/plugins/simple-google-connect/

  2. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 1 year ago #

    Actually already had that fixed in my working copy, just hadn't committed it yet. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic