Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#51172 closed defect (bug) (duplicate)

l10n.php missing validation

Reported by: vickdini's profile 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
4 years 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

Version 0, edited 4 years ago by vickdini (next)

#2 @SergeyBiryukov
4 years 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
4 years ago

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