WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 5 months ago

#34385 new enhancement

Missing site_url path results in array to string conversion

Reported by: adormann Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3.1
Component: Rewrite Rules Keywords:
Focuses: Cc:
PR Number:

Description

Given WP_Rewrite is used in verbose mode (use_verbose_mode = true), site_url() does not contain any path component and a rule which does not match home_url() is added to WP_Rewrite::$rewrite_rules, WordPress runs into an Array to string conversion within $wp_rewrite->mod_rewrite_rules().

The origin of this issue is in wp-includes/rewrite.php#L1902 and the Array-to-String-Typecast occurs in wp-includes/rewrite.php#L1952.

Interestingly, $home_root has a safety net against this special case. When no path is set, it defaults to "/" (Introduced in Changeset 9516). Unfortunately, this is not the case for $site_root.

Change History (0)

Note: See TracTickets for help on using tickets.