[Plugin: Gallery3 Picker] 403 – Forbidden after pick image
-
Hi,
after choose the image I get an error “403 – Forbidden”.
I noticed a strange url:
http:…/media-upload.php?tab=gallery3_picker&post_id=0&gallery3_picker_id=103&
thumb=https://www.xxx.yy/gallery3/var/thumbs/image.jpg?m=1234567890As you can see there is a ‘?’ before the last parameter. If I change this with a ‘&’ it’s work. I think Gallery3 add this parameter because the Rest mudule installed, but I’m not sure.
In /wp-content/plugins/gallery3-picker/gallery.js there is this function:
function fetchImage(data) { window.location = userSettings.url + 'wp-admin/media-upload.php?tab=gallery3_picker&post_id=' + post_id + '&gallery3_picker_id=' + data.id + '&thumb=' + data.thumb; }
Inspecting data there are two properties:
id: #number#
thumb: #url with query e.g. http:…/gallery3/var/thumbs/image.jpg?m=1234567890#A quick workaround could be change the function like this:
function fetchImage(data) { var url = data.thumb.split("?m="); // window.location = userSettings.url + 'wp-admin/media-upload.php?tab=gallery3_picker&post_id=' + post_id + '&gallery3_picker_id=' + data.id + '&thumb=' + data.thumb; window.location = userSettings.url + 'wp-admin/media-upload.php?tab=gallery3_picker&post_id=' + post_id + '&gallery3_picker_id=' + data.id + '&thumb=' + url[0]; }
From the url I extracted the path without the query. I did some tests and it works.
Is there a better solution?
Thank you very much.
https://www.ads-software.com/extend/plugins/gallery3-picker/
- The topic ‘[Plugin: Gallery3 Picker] 403 – Forbidden after pick image’ is closed to new replies.