WordPress.org

Making WordPress.org

Changeset 4964


Ignore:
Timestamp:
02/20/2017 11:49:01 PM (5 years ago)
Author:
ocean90
Message:

WordPress.org SSO: Remove & operator for objects, fix whitespace usage, and update DocBlocks.

Location:
sites/trunk/common/includes/wporg-sso
Files:
2 edited

Legend:

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

    r4960 r4964  
    22if ( ! class_exists( 'WPOrg_SSO' ) ) {
    33    /**
    4      * Single Sign-On (SSO) handling for WordPress/bbPress/GlotPress instances under *.wordpress.org.
     4     * Single Sign-On (SSO) handling for WordPress/bbPress instances under *.wordpress.org.
    55     *
    66     * @author stephdau
     
    5151
    5252            // If we got a host by now, it's a safe wordpress.org-based one, add it to the list of allowed redirects
    53             if ( ! empty( $host ) && ! in_array( $host, $hosts ) ){
     53            if ( ! empty( $host ) && ! in_array( $host, $hosts ) ) {
    5454                $hosts[] = $host;
    5555            }
     
    8181
    8282        }
    83 
    8483
    8584        /**
     
    114113                    $redirect_to = $redirect_to_referrer;
    115114                }
    116             } else{
     115            } else {
    117116                // Otherwise, attempt to guess the parent dir of where they came from and validate that.
    118117                $redirect_to_source_parent = preg_replace( '/\/[^\/]+\.php\??.*$/', '/', "https://{$this->host}{$_SERVER['REQUEST_URI']}" );
     
    153152         * Validates if target URL is within our bounds, then redirects to it if so, or to WP.org homepage (returns if headers already sent).
    154153         *
    155          * @param string $to Destination URL
    156          * @param number $status HTTP redirect status, defaults to 302
     154         * @note: using our own over wp_safe_redirect(), etc, because not all targeted platforms (WP/BB/GP/etc) implement an equivalent, we run early, etc.
    157155         *
    158          * @note: using our own over wp_safe_redirect(), etc, because not all targeted platforms (WP/BB/GP/etc) implement an equivalent, we run early, etc.
     156         * @param string $to     Destination URL
     157         * @param int    $status HTTP redirect status, defaults to 302
    159158         */
    160159        protected function _safe_redirect( $to, $status = 302 ) {
  • sites/trunk/common/includes/wporg-sso/wp-plugin.php

    r4963 r4964  
    147147
    148148            // Add our host to the list of allowed ones.
    149             add_filter( 'allowed_redirect_hosts', array( &$this, 'add_allowed_redirect_host' ) );
     149            add_filter( 'allowed_redirect_hosts', array( $this, 'add_allowed_redirect_host' ) );
    150150
    151151            // Replace some URLs by our own.
    152             add_filter( 'lostpassword_url', array( &$this, 'lostpassword_url' ), 20, 2 );
     152            add_filter( 'lostpassword_url', array( $this, 'lostpassword_url' ), 20, 2 );
    153153            add_filter( 'site_url', array( $this, 'login_post_url' ), 20, 3 );
    154154            add_filter( 'register_url', array( $this, 'register_url' ), 20 );
     
    216216                                } else {
    217217                                    if ( empty( $_GET['screen'] ) ) {
    218                                         add_filter( 'login_form_defaults', array( &$this, 'login_form_defaults' ) );
     218                                        add_filter( 'login_form_defaults', array( $this, 'login_form_defaults' ) );
    219219                                    }
    220220                                }
     
    241241                } else {
    242242                    // if on login screen, filter network_site_url to make sure our forms go to the SSO host, not wordpress.org
    243                     add_action( 'network_site_url', array( &$this, 'login_network_site_url' ), 10, 3 );
     243                    add_action( 'network_site_url', array( $this, 'login_network_site_url' ), 10, 3 );
    244244                }
    245245            }
     
    255255         * @return string
    256256         *
    257          * @example add_action( 'network_site_url', array( &$this, 'login_network_site_url' ), 10, 3 );
     257         * @example add_action( 'network_site_url', array( $this, 'login_network_site_url' ), 10, 3 );
    258258         */
    259259        public function login_network_site_url( $url, $path, $scheme ) {
Note: See TracChangeset for help on using the changeset viewer.