WordPress.org

Make WordPress Core

#24419 closed defect (bug) (fixed)

Use correct URL in post_formats_compat()

Reported by: tollmanz Owned by: SergeyBiryukov
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.6
Component: Post Formats Keywords:
Focuses: Cc:

Description

When getting the URL for the link post format in post_formats_compat(), the incorrect URL value is used. Within the switch statement, when link is the case, the first conditional statement gets the URL that represents the link and assigns it to $url. Within the next conditional, the HTML for the link is composed. Instead of using $url it uses $meta['link_url']. This value may not be set, which will result in a blank URL being printed (e.g., <a href="http://google.com"></a>).

To reproduce the issue:

  1. Add a new post of link post format
  2. Do not add anything in the Title or Link URL fields
  3. Type "http://google.com" in the post content

This results in:

<a href="http://google.com"></a>

When the expected output is:

<a href="http://google.com">http://google.com</a>

Attachments (1)

24419.patch (672 bytes) - added by tollmanz 11 months ago.

Download all attachments as: .zip

Change History (4)

tollmanz11 months ago

comment:1 tollmanz11 months ago

24419.patch uses $url for the text value of the link.

comment:2 SergeyBiryukov11 months ago

  • Milestone changed from Awaiting Review to 3.6

comment:3 SergeyBiryukov11 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 24353:

Use correct variable. props tollmanz. fixes #24419.

Note: See TracTickets for help on using tickets.