WordPress.org

Make WordPress Core

#20760 closed defect (bug) (duplicate)

Erroneous use of str_replace() in setup-config.php

Reported by: johnbillion Owned by:
Milestone: Priority: low
Severity: normal Version:
Component: Upgrade/Install Keywords: has-patch
Focuses: Cc:

Description

In wp-admin/setup-config.php we have an instance of str_replace() which uses a blank string in the $subject parameter. While it has no detrimental effect, it may as well be removed to avoid some head scratching.

function get_bloginfo() {
	return ( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . str_replace( $_SERVER['PHP_SELF'], '/wp-admin/setup-config.php', '' ) );
}

Attachments (2)

20760.patch (598 bytes) - added by johnbillion 23 months ago.
20760.2.patch (670 bytes) - added by SergeyBiryukov 23 months ago.

Download all attachments as: .zip

Change History (5)

johnbillion23 months ago

comment:1 johnbillion23 months ago

  • Keywords has-patch added

Patch

SergeyBiryukov23 months ago

comment:2 SergeyBiryukov23 months ago

Introduced in [13026].

I guess the idea was to return a correct URL for site in a subdirectory. Perhaps we should fix the order of arguments rather than remove the replacement.

comment:3 SergeyBiryukov23 months ago

  • Component changed from General to Upgrade/Install
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.