WordPress.org

Make WordPress Core

Ticket #22330: 22330.diff

File 22330.diff, 4.3 KB (added by GeertDD, 18 months ago)
  • wp-admin/includes/class-wp-comments-list-table.php

    diff --git wp-admin/includes/class-wp-comments-list-table.php wp-admin/includes/class-wp-comments-list-table.php
    index bb5a95e..391e9f5 100644
    class WP_Comments_List_Table extends WP_List_Table { 
    447447                $author_url = get_comment_author_url(); 
    448448                if ( 'http://' == $author_url ) 
    449449                        $author_url = ''; 
    450                 $author_url_display = preg_replace( '|http://(www\.)?|i', '', $author_url ); 
     450                $author_url_display = preg_replace( '|^http://(www\.)?|i', '', $author_url ); 
    451451                if ( strlen( $author_url_display ) > 50 ) 
    452452                        $author_url_display = substr( $author_url_display, 0, 49 ) . '...'; 
    453453 
  • wp-admin/network.php

    diff --git wp-admin/network.php wp-admin/network.php
    index 2931cbb..7396769 100644
    function network_domain_check() { 
    5151 * @return bool Whether subdomain install is allowed 
    5252 */ 
    5353function allow_subdomain_install() { 
    54         $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'siteurl' ) ); 
     54        $domain = preg_replace( '|^https?://([^/]+)|', '$1', get_option( 'siteurl' ) ); 
    5555        if( false !== strpos( $domain, '/' ) || 'localhost' == $domain || preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $domain ) ) 
    5656                return false; 
    5757 
    function allow_subdirectory_install() { 
    8686function get_clean_basedomain() { 
    8787        if ( $existing_domain = network_domain_check() ) 
    8888                return $existing_domain; 
    89         $domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) ); 
     89        $domain = preg_replace( '|^https?://|', '', get_option( 'siteurl' ) ); 
    9090        if ( $slash = strpos( $domain, '/' ) ) 
    9191                $domain = substr( $domain, 0, $slash ); 
    9292        return $domain; 
  • wp-includes/class-wp-xmlrpc-server.php

    diff --git wp-includes/class-wp-xmlrpc-server.php wp-includes/class-wp-xmlrpc-server.php
    index 14b8334..08a7236 100644
    class wp_xmlrpc_server extends IXR_Server { 
    34073407 
    34083408                /* warning: here we make the assumption that the blog's URL is on the same server */ 
    34093409                $filename = get_option('home') . '/'; 
    3410                 $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); 
     3410                $filename = preg_replace('#^https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); 
    34113411 
    34123412                $f = fopen($filename, 'r'); 
    34133413                $content = fread($f, filesize($filename)); 
    class wp_xmlrpc_server extends IXR_Server { 
    34473447 
    34483448                /* warning: here we make the assumption that the blog's URL is on the same server */ 
    34493449                $filename = get_option('home') . '/'; 
    3450                 $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); 
     3450                $filename = preg_replace('#^https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); 
    34513451 
    34523452                if ($f = fopen($filename, 'w+')) { 
    34533453                        fwrite($f, $content); 
  • wp-includes/default-constants.php

    diff --git wp-includes/default-constants.php wp-includes/default-constants.php
    index 4e5daab..9602f7d 100644
    function wp_cookie_constants( ) { 
    192192         * @since 1.2.0 
    193193         */ 
    194194        if ( !defined('COOKIEPATH') ) 
    195                 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); 
     195                define('COOKIEPATH', preg_replace('|^https?://[^/]+|i', '', get_option('home') . '/' ) ); 
    196196 
    197197        /** 
    198198         * @since 1.5.0 
    199199         */ 
    200200        if ( !defined('SITECOOKIEPATH') ) 
    201                 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); 
     201                define('SITECOOKIEPATH', preg_replace('|^https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); 
    202202 
    203203        /** 
    204204         * @since 2.6.0 
    function wp_cookie_constants( ) { 
    210210         * @since 2.6.0 
    211211         */ 
    212212        if ( !defined('PLUGINS_COOKIE_PATH') ) 
    213                 define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) ); 
     213                define( 'PLUGINS_COOKIE_PATH', preg_replace('|^https?://[^/]+|i', '', WP_PLUGIN_URL) ); 
    214214 
    215215        /** 
    216216         * @since 2.0.0 
  • wp-includes/formatting.php

    diff --git wp-includes/formatting.php wp-includes/formatting.php
    index fcf519c..984b384 100644
    function like_escape($text) { 
    27042704 * @return string Absolute path. 
    27052705 */ 
    27062706function wp_make_link_relative( $link ) { 
    2707         return preg_replace( '|https?://[^/]+(/.*)|i', '$1', $link ); 
     2707        return preg_replace( '|^https?://[^/]+(/.*)|i', '$1', $link ); 
    27082708} 
    27092709 
    27102710/**