Skip to content

Commit

Permalink
Account for an empty siteurl in the database
Browse files Browse the repository at this point in the history
  • Loading branch information
kadencewp committed Dec 11, 2024
1 parent 301a5d4 commit d134ede
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Uplink/Site/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ public function get_domain( bool $original = false ): string {
protected function get_domain_multisite_option(): string {
/** @var string */
$site_url = get_site_option( 'siteurl', '' );

// Fallback to get_site_url function if the network site url is empty which is possible.
if ( empty( $site_url ) ) {
$site_url = get_site_url();
}
/** @var array<string> */
$site_url = wp_parse_url( $site_url );
if ( ! $site_url || ! isset( $site_url['host'] ) ) {
Expand Down

0 comments on commit d134ede

Please sign in to comment.