WordPress.org

Make WordPress Core

Opened 15 months ago

Closed 15 months ago

Last modified 15 months ago

#51172 closed defect (bug) (duplicate)

l10n.php missing validation

Reported by: vickdini Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.5
Component: I18N Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Hi! I was updating an automation script and, while debugging, I noticed that the line 1075 of the file \wp-includes\l10n.php performs a comparison operation between two array elements before verifying the existence of both (i.e. one is verified, the other isn't and this one throws an error):

Current line 1075:

} elseif ( ! isset( $src_url['host'] ) || $src_url['host'] === **$site_url['host']** ) {

Proposed change:

} elseif ( ! isset( $src_url['host'] ) **|| ! isset( $site_url['host'] )** || $src_url['host'] === $site_url['host'] ) {

I hope this helps.

Best regards,

Vick

Change History (3)

#1 @vickdini
15 months ago

Hi! I was updating an automation script and, while debugging, I noticed that the line 1075 of the file \wp-includes\l10n.php performs a comparison operation between two array elements before verifying the existence of both (i.e. one is verified, the other isn't and this one throws an error):

Current line 1075:

} elseif ( ! isset( $src_url['host'] ) || $src_url['host'] === $site_url['host'] ) {

Proposed change:

} elseif ( ! isset( $src_url['host'] ) || ! isset( $site_url['host'] ) || $src_url['host'] === $site_url['host'] ) {

I hope this helps.

Best regards,

Vick

Last edited 15 months ago by vickdini (previous) (diff)

#2 @SergeyBiryukov
15 months ago

  • Description modified (diff)
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there, welcome to WordPress Trac!

Thanks for the report, we're already tracking this issue in #49145.

#3 @SergeyBiryukov
15 months ago

  • Component changed from Upgrade/Install to I18N
Note: See TracTickets for help on using tickets.