Plugin Directory

Changeset 2931939


Ignore:
Timestamp:
06/28/2023 04:36:17 PM (3 years ago)
Author:
machineitsvcs
Message:

Fixed issue with old (non-Javascript) method caused by merge, and removed unnecessary redirect code which could potentially result in redirect loop.

Location:
woo-wp-login
Files:
1 added
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • woo-wp-login/tags/3.0.1/readme.txt

    r2931619 r2931939  
    5151
    5252== Changelog =
     53= 3.0.1 =
     54- Fixed issue with old (non-Javascript) method caused by merge, and removed unnecessary redirect code which could potentially result in redirect loop.
     55
    5356= 3.0.0 =
    5457- Merged free and premium plugin versions. Now providing all premium features free of charge.
  • woo-wp-login/tags/3.0.1/woocommerce-wp-login.php

    r2931626 r2931939  
    55Description: Redirects wp-login.php page to default WooCommerce "My account" page, IF WooCommerce is installed AND active.
    66Text Domain: woo-wp-login
    7 Version: 3.0.0
     7Version: 3.0.1
    88Author: Machine Pro SEO <[email protected]>
    99Author URI: https://www.machineproseo.com
     
    3838                            echo '<input type="hidden" name="redirect-to" value="' . esc_url(add_query_arg(array_map('urlencode', $_GET), $redirect_to)) . '">';
    3939                        }
    40                         foreach ($_POST as $key => $value) {
    41                             if ('redirect-to' !== $key) {
    42                                 echo '<input type="hidden" name="' . esc_attr($key) . '" value="' . esc_attr($value) . '">';
     40                        if (!empty($_POST)) {
     41                            foreach ($_POST as $key => $value) {
     42                                if ('redirect-to' !== $key || empty($redirect_to)) {
     43                                    echo '<input type="hidden" name="' . esc_attr($key) . '" value="' . esc_attr($value) . '">';
     44                                }
    4345                            }
    4446                        }
     
    4749                    }
    4850                    if (!isset($_GET['action']) || 'logout' !== $_GET['action']) {
    49                         $redirect_url = add_query_arg(array('redirect-to', ( !empty($redirect_to) ? $redirect_to : false )), $redirect_url);
     51                        $redirect_url = add_query_arg(array('redirect-to' => ( !empty($redirect_to) ? $redirect_to : false )), $redirect_url);
    5052                        header('refresh:0.1;url=' . esc_url($redirect_url));
    5153                        exit();
     
    8385                        }
    8486                    }
    85                     if (wp_safe_redirect(esc_url_raw(add_query_arg(array_merge(array_map('urlencode', array_filter(array_merge($_GET, array('reauth' => false, 'redirect-to' => false, 'redirect_to' => false)))), array('redirect-to' => false, 'redirect_to' => false, 'reauth' => false)), $myaccount_redirect)))) {
     87                    if (wp_safe_redirect(esc_url_raw(add_query_arg(array_merge(array_map('urlencode', array_filter(array_merge($_GET, array('redirect-to' => false, 'redirect_to' => false, 'reauth' => false)))), array('redirect-to' => false, 'redirect_to' => false, 'reauth' => false)), $myaccount_redirect)))) {
    8688                        exit();
    8789                    }
     
    118120                }
    119121            }
    120             if (!empty($_GET['redirect-to']) || !empty($_GET['redirect_to'])) {
    121                 if (is_user_logged_in() && (!isset($_GET['action']) || !in_array($_GET['action'], $action_array))) {
    122                     $user = wp_get_current_user();
    123                     if ($user && property_exists($user, 'user_login')) {
    124                         woo_wp_login($user->user_login, $user);
    125                     }
    126                 } else {
    127                     $redirect_to = ( !empty($_GET['redirect-to']) ? sanitize_text_field($_GET['redirect-to']) : ( !empty($_GET['redirect_to']) ? sanitize_text_field($_GET['redirect_to']) : '' ) );
    128                     $redirect_url = add_query_arg(array_map('urlencode', array_filter(array_merge($_GET, array('redirect-to' => false, 'redirect_to' => false)))), $myaccount);
    129                     woo_wp_login_redirect($redirect_url, $pagenow, $redirect_to);
    130                 }
    131             }
    132122        }
    133123    });
  • woo-wp-login/trunk/readme.txt

    r2931619 r2931939  
    5151
    5252== Changelog =
     53= 3.0.1 =
     54- Fixed issue with old (non-Javascript) method caused by merge, and removed unnecessary redirect code which could potentially result in redirect loop.
     55
    5356= 3.0.0 =
    5457- Merged free and premium plugin versions. Now providing all premium features free of charge.
  • woo-wp-login/trunk/woocommerce-wp-login.php

    r2931626 r2931939  
    55Description: Redirects wp-login.php page to default WooCommerce "My account" page, IF WooCommerce is installed AND active.
    66Text Domain: woo-wp-login
    7 Version: 3.0.0
     7Version: 3.0.1
    88Author: Machine Pro SEO <[email protected]>
    99Author URI: https://www.machineproseo.com
     
    3838                            echo '<input type="hidden" name="redirect-to" value="' . esc_url(add_query_arg(array_map('urlencode', $_GET), $redirect_to)) . '">';
    3939                        }
    40                         foreach ($_POST as $key => $value) {
    41                             if ('redirect-to' !== $key) {
    42                                 echo '<input type="hidden" name="' . esc_attr($key) . '" value="' . esc_attr($value) . '">';
     40                        if (!empty($_POST)) {
     41                            foreach ($_POST as $key => $value) {
     42                                if ('redirect-to' !== $key || empty($redirect_to)) {
     43                                    echo '<input type="hidden" name="' . esc_attr($key) . '" value="' . esc_attr($value) . '">';
     44                                }
    4345                            }
    4446                        }
     
    4749                    }
    4850                    if (!isset($_GET['action']) || 'logout' !== $_GET['action']) {
    49                         $redirect_url = add_query_arg(array('redirect-to', ( !empty($redirect_to) ? $redirect_to : false )), $redirect_url);
     51                        $redirect_url = add_query_arg(array('redirect-to' => ( !empty($redirect_to) ? $redirect_to : false )), $redirect_url);
    5052                        header('refresh:0.1;url=' . esc_url($redirect_url));
    5153                        exit();
     
    8385                        }
    8486                    }
    85                     if (wp_safe_redirect(esc_url_raw(add_query_arg(array_merge(array_map('urlencode', array_filter(array_merge($_GET, array('reauth' => false, 'redirect-to' => false, 'redirect_to' => false)))), array('redirect-to' => false, 'redirect_to' => false, 'reauth' => false)), $myaccount_redirect)))) {
     87                    if (wp_safe_redirect(esc_url_raw(add_query_arg(array_merge(array_map('urlencode', array_filter(array_merge($_GET, array('redirect-to' => false, 'redirect_to' => false, 'reauth' => false)))), array('redirect-to' => false, 'redirect_to' => false, 'reauth' => false)), $myaccount_redirect)))) {
    8688                        exit();
    8789                    }
     
    118120                }
    119121            }
    120             if (!empty($_GET['redirect-to']) || !empty($_GET['redirect_to'])) {
    121                 if (is_user_logged_in() && (!isset($_GET['action']) || !in_array($_GET['action'], $action_array))) {
    122                     $user = wp_get_current_user();
    123                     if ($user && property_exists($user, 'user_login')) {
    124                         woo_wp_login($user->user_login, $user);
    125                     }
    126                 } else {
    127                     $redirect_to = ( !empty($_GET['redirect-to']) ? sanitize_text_field($_GET['redirect-to']) : ( !empty($_GET['redirect_to']) ? sanitize_text_field($_GET['redirect_to']) : '' ) );
    128                     $redirect_url = add_query_arg(array_map('urlencode', array_filter(array_merge($_GET, array('redirect-to' => false, 'redirect_to' => false)))), $myaccount);
    129                     woo_wp_login_redirect($redirect_url, $pagenow, $redirect_to);
    130                 }
    131             }
    132122        }
    133123    });
Note: See TracChangeset for help on using the changeset viewer.