[wp-trac] [WordPress Trac] #34385: Missing site_url path results in array to string conversion
WordPress Trac
noreply at wordpress.org
Wed Oct 21 08:55:15 UTC 2015
#34385: Missing site_url path results in array to string conversion
---------------------------+-----------------------------
Reporter: adormann | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Rewrite Rules | Version: 4.3.1
Severity: normal | Keywords:
Focuses: |
---------------------------+-----------------------------
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
[https://core.trac.wordpress.org/browser/tags/4.3.1/src/wp-
includes/rewrite.php#L1902 wp-includes/rewrite.php#L1902] and the Array-
to-String-Typecast occurs in
[https://core.trac.wordpress.org/browser/tags/4.3.1/src/wp-
includes/rewrite.php#L1952 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
[https://core.trac.wordpress.org/changeset/9516 Changeset 9516]).
Unfortunately, this is not the case for $site_root.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34385>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list