[wp-trac] [WordPress Trac] #51172: l10n.php missing validation

WordPress Trac noreply at wordpress.org
Fri Aug 28 10:05:46 UTC 2020


#51172: l10n.php missing validation
-----------------------------+------------------------------
 Reporter:  vickdini         |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Upgrade/Install  |     Version:  5.5
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by vickdini):

 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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51172#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list