WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#4834 closed defect (bug) (fixed)

get_permalink() shouldn't work for posts that don't exist

Reported by: Viper007Bond Owned by:
Milestone: 2.3 Priority: low
Severity: minor Version: 2.3
Component: Template Keywords: has-patch 2nd-opinion
Focuses: Cc:

Description

get_permalink('bananas') shouldn't return a URL (it currently does). Attached patch adds a quick check to see that the entered post ID actually exists and returns FALSE if it doesn't.

Attachments (1)

link-template.patch (420 bytes) - added by Viper007Bond 8 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 @ryan8 years ago

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

(In [5956]) Don't return permalink for non-existent post. Props Viper007Bond. fixes #4834

comment:2 @westi7 years ago

  • Milestone changed from 2.4 to 2.3
Note: See TracTickets for help on using tickets.