Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#51172 closed defect (bug) (duplicate)

l10n.php missing validation

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

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
6 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 6 years ago by vickdini (next)

#2 @SergeyBiryukov
6 years ago

  • Description modified (diff)
  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → closed

Hi there, welcome to WordPress Trac!

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

#3 @SergeyBiryukov
6 years ago

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