WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 months ago

#34504 closed defect (bug) (wontfix)

get_blogaddress_by_name() does not reflect scheme of the blog

Reported by: johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: needs-patch has-unit-tests https
Focuses: multisite Cc:

Description

get_blogaddress_by_name() suffers from the same problem that get_blogaddress_by_id() suffered from as reported in #14867 and fixed in [35446]. The scheme of the returned URL does not reflect that of the actual blog.

In addition, the scheme of the return URL gets polluted by the current request.

Attachments (1)

34504.tests.diff (1.4 KB) - added by johnbillion 5 years ago.

Download all attachments as: .zip

Change History (8)

#1 @johnbillion
5 years ago

  • Keywords has-unit-tests added

#2 @johnbillion
5 years ago

  • Keywords https added

#3 @jeremyfelt
5 years ago

  • Keywords changed from needs-patch, has-unit-tests, https to needs-patch has-unit-tests https

It seems like the only context this is used in is wp-signup.php as a way to display what a new site's address would be if it was created. In that case, using the scheme of network_home_url() may still make sense.

I could also see finding a way to deprecate get_blogaddress_by_name().

#4 follow-up: @flixos90
5 years ago

This bug could be fixed with #35791 and #31405. We could make a WP_Site_Query to get the site and then use the original URL scheme to return the original scheme.

#5 in reply to: ↑ 4 @thomaswm
5 years ago

Replying to flixos90:

We could make a WP_Site_Query to get the site and then use the original URL scheme to return the original scheme.

As jeremyfelt said, the function is only used in wp-signup.php to display the text

'The site you were looking for, %s, does not exist, but you can create it now!'

As the site does not exist yet, its scheme cannot be determined by querying the database for its home URL or site URL. Therefore, this ticket might be a wontfix.

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


4 years ago

#7 @johnbillion
4 months ago

  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.