Making WordPress.org

Changeset 4957


Ignore:
Timestamp:
02/20/2017 10:25:53 AM (10 years ago)
Author:
ocean90
Message:

WordPress.org SSO: Don't append an empty redirect_to argument to the lost password URL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/wporg-sso/wp-plugin.php

    r4470 r4957  
    292292                 * Filters the default lost password URL and returns our custom one instead.
    293293                 *
    294                  * @param string $lostpassword_url
    295                  * @param string $redirect
     294                 * @param string $lostpassword_url The lost password page URL.
     295                 * @param string $redirect         The path to redirect to on login.
     296                 * @return string New lost password URL.
    296297                 */
    297298                public function lostpassword_url( $lostpassword_url, $redirect ) {
    298                         return $this->sso_host_url . $this->valid_sso_paths['lostpassword'] . '/?redirect_to=' . $redirect;
     299                        $lostpassword_url = $this->sso_host_url . $this->valid_sso_paths['lostpassword'];
     300
     301                        if ( ! empty( $redirect ) ) {
     302                                $lostpassword_url = add_query_arg( 'redirect_to', $redirect, $lostpassword_url );
     303                        }
     304
     305                        return $lostpassword_url;
    299306                }
    300307
Note: See TracChangeset for help on using the changeset viewer.