WordPress.org

Make WordPress Core

Opened 12 months ago

Last modified 10 months 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.

Change History (1)

#1 @hellofromTonya
10 months ago

  • Version changed from trunk to 2.3
Note: See TracTickets for help on using tickets.