Make WordPress Core

Ticket #22330: 22330.2.diff

File 22330.2.diff, 3.1 KB (added by nacin, 11 years ago)
  • wp-admin/includes/class-wp-comments-list-table.php

     
    497497                $author_url = get_comment_author_url();
    498498                if ( 'http://' == $author_url )
    499499                        $author_url = '';
    500                 $author_url_display = preg_replace( '|http://(www\.)?|i', '', $author_url );
     500                $author_url_display = preg_replace( '|^http://(www\.)?|i', '', $author_url );
    501501                if ( strlen( $author_url_display ) > 50 )
    502502                        $author_url_display = substr( $author_url_display, 0, 49 ) . '…';
    503503
  • wp-admin/network.php

     
    5151 * @return bool Whether subdomain install is allowed
    5252 */
    5353function allow_subdomain_install() {
    54         $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) );
     54        $domain = preg_replace( '|^https?://([^/]+)|', '$1', get_option( 'home' ) );
    5555        if( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' == $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) )
    5656                return false;
    5757
     
    9393function get_clean_basedomain() {
    9494        if ( $existing_domain = network_domain_check() )
    9595                return $existing_domain;
    96         $domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) );
     96        $domain = preg_replace( '|^https?://|', '', get_option( 'siteurl' ) );
    9797        if ( $slash = strpos( $domain, '/' ) )
    9898                $domain = substr( $domain, 0, $slash );
    9999        return $domain;
  • wp-includes/default-constants.php

     
    211211         * @since 1.2.0
    212212         */
    213213        if ( !defined('COOKIEPATH') )
    214                 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
     214                define('COOKIEPATH', preg_replace('|^https?://[^/]+|i', '', get_option('home') . '/' ) );
    215215
    216216        /**
    217217         * @since 1.5.0
    218218         */
    219219        if ( !defined('SITECOOKIEPATH') )
    220                 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
     220                define('SITECOOKIEPATH', preg_replace('|^https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
    221221
    222222        /**
    223223         * @since 2.6.0
     
    229229         * @since 2.6.0
    230230         */
    231231        if ( !defined('PLUGINS_COOKIE_PATH') )
    232                 define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) );
     232                define( 'PLUGINS_COOKIE_PATH', preg_replace('|^https?://[^/]+|i', '', WP_PLUGIN_URL) );
    233233
    234234        /**
    235235         * @since 2.0.0
  • wp-includes/formatting.php

     
    30893089 * @return string Absolute path.
    30903090 */
    30913091function wp_make_link_relative( $link ) {
    3092         return preg_replace( '|https?://[^/]+(/.*)|i', '$1', $link );
     3092        return preg_replace( '|^https?://[^/]+(/.*)|i', '$1', $link );
    30933093}
    30943094
    30953095/**