Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 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:


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 11 years ago.

Download all attachments as: .zip

Change History (3)

#1 @ryan
11 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

#2 @westi
11 years ago

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