WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#2166 closed defect (bug) (fixed)

# in uploaded image filename breaks uploader

Reported by: Viper007Bond Owned by: skeltoac
Priority: normal Milestone:
Component: Administration Version: 1.2
Severity: normal Keywords: bg|has-patch bg|commit
Cc:

Description

Rename an image to have a # in it, ex:

2003 Dodge Viper SRT-10 #09.jpg

If you upload it, it uploads fine, but then when it goes to display the thumbnail or insert into the post, this is the URL it uses:

2003%20Dodge%20Viper%20SRT-10%20#09.thumbnail.jpg

Rather than:

2003%20Dodge%20Viper%20SRT-10%20%2309.thumbnail.jpg

That causes a 404 on the image.

No patch as I don't know Javascript.

Attachments (2)

2166.diff (2.2 KB) - added by davidhouse 7 years ago.
lose-those-pounds.diff (454 bytes) - added by skeltoac 7 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 ryan7 years ago

  • Owner changed from anonymous to skeltoac

comment:2 davidhouse7 years ago

  • Keywords bg|has-patch added

There wasn't actually any javascript involved. :) This patch will need a quick run-through by the committor, because I don't use the image uploader and so I'm not entirely sure if the patch works completely or not.

davidhouse7 years ago

comment:3 skeltoac7 years ago

  • Status changed from new to assigned

wp-admin/admin-functions.php line 1752 is the only place that needs rawurlencode. However, when I test in FF and IE, %23 is in the src and href but the browser decodes it and puts # in the request, which of course gets a 404.

I think it would be better to replace # with _

skeltoac7 years ago

comment:4 davidhouse7 years ago

  • Keywords bg|commit added

Whatever Andy's happy with :)

comment:5 ryan7 years ago

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

(In [3394]) Strip # from filenames. fixes #2166

comment:6 ryan7 years ago

  • Milestone set to 2.0.1

comment:7 anonymous7 years ago

  • Milestone 2.0.1 deleted

Milestone 2.0.1 deleted

Note: See TracTickets for help on using tickets.