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.


git-svn-id: https://develop.svn.wordpress.org/trunk@32503 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-05-13 21:41:47 +00:00
parent 23e40ef756
commit 11671ad73b
1 changed files with 3 additions and 1 deletions

View File

@ -231,7 +231,9 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
jQuery("#TB_load").remove(); jQuery("#TB_load").remove();
jQuery("#TB_window").css({'visibility':'visible'}); jQuery("#TB_window").css({'visibility':'visible'});
}else{ }else{
jQuery("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method var load_url = url;
load_url += -1 === url.indexOf('?') ? '?' : '&';
jQuery("#TB_ajaxContent").load(load_url += "random=" + (new Date().getTime()),function(){//to do a post change this load method
tb_position(); tb_position();
jQuery("#TB_load").remove(); jQuery("#TB_load").remove();
tb_init("#TB_ajaxContent a.thickbox"); tb_init("#TB_ajaxContent a.thickbox");