diff --git a/core/um-permalinks.php b/core/um-permalinks.php index eb0089f3..84290b08 100644 --- a/core/um-permalinks.php +++ b/core/um-permalinks.php @@ -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'; diff --git a/core/um-short-functions.php b/core/um-short-functions.php index 61a22cbe..8b3e6baf 100644 --- a/core/um-short-functions.php +++ b/core/um-short-functions.php @@ -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; } \ No newline at end of file