Opened 7 months ago

Last modified 7 months ago

#22135 new defect (bug)

Special characters in caption lead to failure of inserting images

Reported by: TobiasBg Owned by:
Priority: normal Milestone: Awaiting Review
Component: Media Version: 3.4.2
Severity: normal Keywords: 2nd-opinion
Cc: mdhansen@…

Description

Found this when double-checking #22132:

  1. Go to add a new post.
  2. Click "Upload/Insert" (the "old" media upload).
  3. Upload an image, or go to choose one from the media library.
  4. Insert Title"<script>alert('Title');</script> in the "Caption" field.
  5. Click "Insert into Post".

Instead of the image (or Shortcode) being added to the editor (with a somehow escaped caption field), the media upload iframe just gets a new content:

[/caption]'); /* ]]> */

Reproduced in 3.4.2 and trunk.

Attachments (1)

caption-error.png (19.5 KB) - added by MikeHansenMe 7 months ago.
screenshot of the error

Download all attachments as: .zip

Change History (4)

screenshot of the error

I was able to reproduce the error. It also allowed the alert on the front end. I am not sure if this will need to be addressed once the new media update is fully implemented.

  • Cc mdhansen@… added
  • Keywords 2nd-opinion added
Note: See TracTickets for help on using tickets.