From 1c0fa5f73aa52dcdc262c5b3451a04e6f45232c3 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 13 May 2015 21:42:24 +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. Built from https://develop.svn.wordpress.org/trunk@32503 git-svn-id: http://core.svn.wordpress.org/trunk@32473 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/thickbox/thickbox.js | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/js/thickbox/thickbox.js b/wp-includes/js/thickbox/thickbox.js index 09c8a993a1..60a9eb77a5 100644 --- a/wp-includes/js/thickbox/thickbox.js +++ b/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"); diff --git a/wp-includes/version.php b/wp-includes/version.php index 762875d23c..0a312c8c3f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32502'; +$wp_version = '4.3-alpha-32503'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.