Hmmm - can't this be done already with htaccess ?
Something like:
Quote:
<FilesMatch "attachment\.php">
RewriteCond %{HTTP_REFERRER} !^http://(www\.)?example.com(/)?.*$ [NC]
RewriteRule .*\.*$ - [F,NC]
</FilesMatch>
|
And when using the filesystem as storage:
Quote:
<LocationMatch "/uploads">
RewriteCond %{HTTP_REFERRER} !^http://(www\.)?example.com(/)?.*$ [NC]
RewriteRule .*\.*$ - [F,NC]
</LocationMatch>
|
Or is there any difference like some additional check ? Reading the addon, if I understand it right you parse HTTP_REFERRER too via PHP, doing it directly via the Server is maybe less portable, but maybe also faster that PHP doesn't need to be called everytime.