WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#6428 closed defect (bug) (fixed)

File URL option inserts wrong code into post

Reported by: moshu Owned by:
Milestone: 2.5 Priority: high
Severity: blocker Version: 2.5
Component: Administration Keywords: image upload has-patch
Focuses: Cc:

Description

When you are on the Add Image popup and get an image uploaded or selected from the media library, there is an option called Link URL. It has 3 preset options:

None
File URL
Post URL

None - works as expected.
However, the File URL which should make the image linked directly to the image file, results in the same as Post URL: the click goes to the "attachment" view, creating/having an URL like
example.com/?attachment_id=XX

instead of what is displayed in the field when selecting "File URL":
example.com/wp-content/uploads/2008/03/mypic.jpg

I would expect that selecting "File URL" would result in an image displayed in the post AND having a direct link to the image file itself.

Tested on a local install (XAMPP v.1.4.12)
Apache 2.0.53
PHP 5.0.3

Attachments (1)

6428.diff (603 bytes) - added by andy 6 years ago.
do not add rel if link is not get_attachment_link

Download all attachments as: .zip

Change History (4)

comment:1 moshu6 years ago

  • Component changed from General to Administration
  • Severity changed from normal to major

andy6 years ago

do not add rel if link is not get_attachment_link

comment:2 andy6 years ago

  • Keywords has-patch added; URL removed
  • Priority changed from normal to high
  • Severity changed from major to blocker

comment:3 ryan6 years ago

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

(In [7557]) do not add rel if link is not get_attachment_link. Props andy. fixes #6428

Note: See TracTickets for help on using tickets.