Make WordPress Core

Opened 5 months ago

Last modified 8 weeks ago

#46387 reviewing defect (bug)

Undefined index notice in wp-includes/l10n.php on line 950

Reported by: tditlu Owned by: SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: normal Version: trunk
Component: I18N Keywords: has-patch
Focuses: Cc:


If WP_CONTENT_URL is set to a root path e.g. http://example.com not http://example.com/wp-content (Which boilerplate frameworks like Bedrock & WordPlate do), the return object from wp_parse_url doesn't include a path value.

Adding a check if path is set in load_script_textdomain after wp_parse_url would solve this issue:

// Added to wp-includes/l10n.php, line 947
if ( empty( $content_url['path'] ) ) {
    $content_url['path'] = '/';

Related to these issues:

Attachments (3)

46387.diff (0 bytes) - added by odminstudios 2 months ago.
46387.2.diff (0 bytes) - added by odminstudios 2 months ago.
46387.3.diff (508 bytes) - added by odminstudios 2 months ago.

Download all attachments as: .zip

Change History (10)

#1 @swissspidy
5 months ago

  • Component changed from Cron API to I18N

#2 @SergeyBiryukov
4 months ago

#46672 was marked as a duplicate.

#3 @tditlu
2 months ago

Is there anything I could do to speed up implementing this fix?

2 months ago

#4 @odminstudios
2 months ago

  • Keywords has-patch added
  • Version set to trunk

Added a check if $content_urlpath? exists.
This should solve issues when content_url() returns no paths.

Please use 46387.3.diff, previous 2 are empty

#5 @Shelob9
8 weeks ago

I had this issue on a local site using localhost url. I applied https://core.trac.wordpress.org/attachment/ticket/46387/46387.3.diff from @odminstudios The notice was no longer present after applying patch.

#6 @SergeyBiryukov
8 weeks ago

  • Milestone changed from Awaiting Review to 5.3

#7 @SergeyBiryukov
8 weeks ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing
Note: See TracTickets for help on using tickets.