Quantcast
Channel: WordPress.org Forums » [WordPress MU Domain Mapping] Support
Viewing all articles
Browse latest Browse all 3502

Vanity Domain Case

$
0
0

Replies: 0

I like to user upper and lower case in spelling out my domain names to make it easier. i.e. WordPress.org

Wordpress ends up using that exact case in putting links on pages, etc.

It works with everything that I’ve used until now with this plugin.

It’s because in your plugin you assume $_SERVER[ ‘HTTP_HOST’ ] will be the same case as the domain it’s configured for. But it’s not.

When your root network domain has upper and lower case, you can’t even get into the admin panel (ever had someone say your plugin prevented even their site from loading? yeah, that may be the smoking gun).

Here are three lines of code I’ve changed to get this to work correctly, I hope you end up putting them in, so an update in the future doesn’t re-break my sites.

:^D

domain_mapping.php

line 519:
$domain = $wpdb->get_var( “SELECT domain FROM {$wpdb->dmtable} WHERE blog_id = ‘{$wpdb->blogid}’ AND lower( domain ) = ‘” . $wpdb->escape( strtolower( $_SERVER[ ‘HTTP_HOST’ ] ) ) . “‘ LIMIT 1” );

line 615:
if ( false === strpos( strtolower( $url ), strtolower( $_SERVER[ ‘HTTP_HOST’ ] ) ) ) {

line 624:
if ( false === strpos( strtolower( $url ), strtolower( $_SERVER[ ‘HTTP_HOST’ ] ) ) ) {


Viewing all articles
Browse latest Browse all 3502

Trending Articles