[wp-trac] [WordPress Trac] #51508: Fix for canonical.php

WordPress Trac noreply at wordpress.org
Tue Oct 13 12:20:40 UTC 2020


#51508: Fix for canonical.php
----------------------------+-----------------------------
 Reporter:  anatolykulikov  |      Owner:  (none)
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Canonical       |    Version:  trunk
 Severity:  trivial         |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 In extremely rare cases it is impossible to determine the path

 {{{#!php
 <?php
 74. $original = parse_url( $requested_url );
 }}}

 I propose a very simple solution - check if the path was parsed correctly
 and if the host parameter has:

 {{{#!php
 <?php
 74. $original = parse_url( $requested_url );
 75. if ( false === $original || !isset($original['host'])) {
 76.     return;
 77. }
 }}}


 You can simply check for the presence of this key, but if it is not there
 for some reason, then it is better to simply complete this function.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51508>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list