Opened 4 years ago
Last modified 4 years ago
#51508 new enhancement
Fix for canonical.php
Reported by: | anatolykulikov | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | trivial | Version: | 2.3 |
Component: | Canonical | Keywords: | |
Focuses: | Cc: |
Description
In extremely rare cases it is impossible to determine the path
<?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 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.
Note: See
TracTickets for help on using
tickets.