From 11671ad73b42b0951118ba25e2ead72993e44297 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 13 May 2015 21:41:47 +0000 Subject: [PATCH] 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 --- src/wp-includes/js/thickbox/thickbox.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/js/thickbox/thickbox.js b/src/wp-includes/js/thickbox/thickbox.js index 09c8a993a1..60a9eb77a5 100644 --- a/src/wp-includes/js/thickbox/thickbox.js +++ b/src/wp-includes/js/thickbox/thickbox.js @@ -231,7 +231,9 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic jQuery("#TB_load").remove(); jQuery("#TB_window").css({'visibility':'visible'}); }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(); jQuery("#TB_load").remove(); tb_init("#TB_ajaxContent a.thickbox");