Fix profile permalink in a multi-site setup

This commit is contained in:
champsupertramp
2016-06-29 16:43:03 +08:00
parent a3ed3123ba
commit 67c3e6e322
2 changed files with 13 additions and 2 deletions
+2 -2
View File
@@ -79,8 +79,8 @@ class UM_Permalinks {
$page_url .= '?' . $_SERVER['QUERY_STRING'];
}
}else {
if( $_SERVER[ $server_name_method ] == "localhost" ){
if( um_core_is_local() ){
$page_url = 'http';
+11
View File
@@ -1726,4 +1726,15 @@ function um_fetch_user( $user_id ) {
}
return $loop;
}
/**
* Check if running local
* @return boolean
*/
function um_core_is_local() {
if( $_SERVER['HTTP_HOST'] == 'localhost'
|| substr($_SERVER['HTTP_HOST'],0,3) == '10.'
|| substr($_SERVER['HTTP_HOST'],0,7) == '192.168') return true;
return false;
}