I made a plugin that includes a blueprint with a select field that get options from a json file saved in the media folder. It was working very well until the hosting changed security settings and now I can’t use anymore the query url: "{{ site.url }}/media/plugins/msnlnz/cart/countries.js" as it’s blocked for security reasons and have to access to the file with a local path. I tried to replace {{ site.url }} with {{ root.site }} but it doesn’t work. I can I access to that folder via blueprint?
Thanks!
Basically they blocked this kind of requests. Also, my plugin was using file_get_contents to get the json file stored in the media folder, but as it was using a global link via the $site->url() object, was blocked by the server throwing a 403 error. I had to rewrite the plugin using local paths with the $kirby->root('media') but it doesn’t work on blueprint…
I think the only solution is to use a local path. If {{ site.url }} generates and http url, what can I use instead to get the local path to the media folder? Thanks
Still wondering what exactly they are blocking in the name of security? All calls to a URL instead of a path? What if you use a route that in turns gets the data from the path?
I don’t know exactly, and I’m quite desperate because I’m using that hosting for most of my websites but that’s another problem. Recently I found that is creating the same problem also with the library of mPDF I use on this kirby website Bulletta — ZAA. If you click on the bottom right button and generate the pdf, most of the times the images are missing, and that’s again that 403 error. They replied that “that kind of URL calls were creating issues of stability because are often used to create infinity loops…”