WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#31726 closed defect (bug) (fixed)

Thickbox add wrongly &random param to URL for videos

Reported by: thomask Owned by: wonderboymusic
Milestone: 4.3 Priority: normal
Severity: normal Version: 4.1.1
Component: Media Keywords:
Focuses: Cc:

Description

This seems to be a very old unnoticed bug of thickbox, e.g. see https://wordpress.org/support/topic/plugin-wp-table-reloaded-display-data-from-other-database?replies=21#post-2510147, http://forum.opencart.com/viewtopic.php?f=10&t=6116,
http://www.houseoffusion.com/groups/jquery/thread.cfm/threadid:1947

under some cirmutances, it appends "&random=some_random_number" to the attachment URL, but the problem is, it ads this even if the URL do not have any ?param before it, so it results in nonexisting page. I have noticed this when i add thickbox to a href for mp4 videos, and the resulting url was /wp-content/uploads/myvideofile.mp4&random=12345

The problem is on line 234 of thickbox.js

jQuery("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method

Change History (3)

#1 @SergeyBiryukov
5 years ago

  • Component changed from Script Loader to Media

#2 @wonderboymusic
5 years ago

  • Milestone changed from Awaiting Review to 4.3
  • Owner set to wonderboymusic
  • Status changed from new to assigned

Thickbox seems to not be updated since 2007. This is a minor fidget to fix this, so might as well.

#3 @wonderboymusic
5 years ago

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

In 32503:

In tb_show() in thickbox, when loading content into #TB_ajaxContent, make sure a URL with no ? doesn't break when &random= is appended to it.

Thickbox hasn't been updated since 2007, just FYI.

Fixes #31726.

Note: See TracTickets for help on using tickets.