Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ static function trim_url( $url, $path = false ) {
$domain = preg_replace( '/^www\./', '', $url_parts['host'] ) . ( ! empty( $url_parts['port'] ) ? ':' . $url_parts['port'] : '' );

/** Add directory path if needed **/
if ( $path && $url_parts['path'] )
if ( $path && isset( $url_parts['path'] ) )
$domain .= $url_parts['path'];

return $domain;
return sanitize_url( $url_parts['scheme'] . '://' . $domain );

}

/** Returns and unique hash to identify the environment. */
Expand Down