Make WordPress Core

Opened 6 years ago

Last modified 3 years ago

#50044 new defect (bug)

The function get_self_link() in feed.php does not include the port

Reported by: damienwhaley Owned by:
Priority: normal Milestone: Awaiting Review
Component: Feeds Version: 5.5
Severity: normal Keywords: has-patch
Cc: Focuses: template

Description (last modified by SergeyBiryukov)

Hi,

The function get_self_link() in /wp-includes/feed.php re-constructs the URL for the website. This is used for the atom site URL.

I have the situation where my WordPress site is running on a non-standard port. When the link for ATOM is constructed, it is missing the port.

As an example my site is running at ​https://wp.example.com:8080

But the get_self_link() prints it as ​https://wp.example.com

This might be solved by this change set: [45772]

Though in the time I spent looking it seems to be only used to generate the home root/home url of the site without any extra paths. It may or may not solve this problem correctly.

Attachments (2)

50044.diff​ (24.0 KB ) - added by sh4lin 3 years ago.
50044.patch​ (1.3 KB ) - added by sh4lin 3 years ago.
has-patch

Download all attachments as: .zip

Change History (10)

#1 @SergeyBiryukov
6 years ago

  • Description modified (diff)

#2 @Mte90
6 years ago

Looking at the code ​https://github.com/WordPress/wordpress-develop/blob/master/src/wp-includes/feed.php#L626 there is also the problem that dens't support https

This ticket was mentioned in ​PR #4491 on ​WordPress/wordpress-develop by ​@sh4lin.


3 years ago
#3

  • Keywords has-patch added; needs-patch removed
  • Used the Scheme and Port Number that we are getting from the parse_url() function.

Trac ticket: https://core.trac.wordpress.org/ticket/50044

@sh4lin
3 years ago

#4 @Mte90
3 years ago

@sh4lin the diff you attached include also changes in other part of wordpress and remove some tests.
The PR on github is fine, also the patch doesn't address the https.

#5 @sh4lin
3 years ago

@Mte90 I'll update the diff.

By default the URL scheme will be ​http:// but if there exists any scheme in the $host than it will use that.

I have tried this function on the website with ​https:// URL. and it is working.

Is my interpretation of your statement (the patch doesn't address the https.) correct?

Correct me if I am wrong.

Thank you so much.

Last edited 3 years ago by sh4lin (previous) (diff)

#6 @Mte90
3 years ago

You are right, the patch check also the protocol.

@sh4lin
3 years ago

has-patch

#8 @mukesh27
3 years ago

Added slight modern approach in ​PR #4503

Note: See TracTickets for help on using tickets.