Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#51508 new enhancement

Fix for canonical.php

Reported by: anatolykulikov Owned by:
Priority: normal Milestone: Awaiting Review
Component: Canonical Version: 2.3
Severity: trivial Keywords:
Cc: Focuses:

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.

Change History (1)

#1 @hellofromTonya
6 years ago

  • Version trunk → 2.3
Note: See TracTickets for help on using tickets.