WordPress.org

Make WordPress Core

#20760 closed defect (bug) (duplicate)

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

Reported by: johnbillion Owned by:
Priority: low Milestone:
Component: Upgrade/Install Version:
Severity: normal Keywords: has-patch
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 13 months ago.
20760.2.patch (670 bytes) - added by SergeyBiryukov 13 months ago.

Download all attachments as: .zip

Change History (5)

johnbillion13 months ago

comment:1 johnbillion13 months ago

  • Keywords has-patch added

Patch

SergeyBiryukov13 months ago

comment:2 SergeyBiryukov13 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 SergeyBiryukov13 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.