I've set a rule for my images in media folder. Here it is:
<FilesMatch ".(jpg|jpeg|gif|png|php)$">
Order Deny,Allow
Deny from all
</FilesMatch>
This will prevent the visitors to directly gain access to the images. Now, whenever i call a php function like getimagesize()
to get some data from an image, it returns an error, as you can guess:
failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in : C:.....
Now my question is, how can other functions and CMS's core files access my medias and generate thumbnails and stuff, but a function such as getimagesize()
can't?
I'm calling this function right in the middle of a CMS load process, so it does have the same privileges as the CMS itself. How can i go around this? I only want outside visitors not to be able to access these files, not my installation of CMS itself.