Patch for ignoring subdomains
| Project: | Embed filter |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
I found this filter and I find it much more flexible/useful than Emfield (though the CCK model has advantages, it's too complicated and restrictive as it is) so thanks!
I had one problem. Several sites (e.g. photobucket.com) have a different subdomain depending on which web server you are pushed on to by their load balancing/DNS, and it isn't practical to have to list hundreds of subdomains to support a site.
As a result, I have created this simple patch which only cares about the domain, not the subdomain. It just strips the subdomain from the start of $parts['host'] so w53.photobucket.com just becomes photobucket.com
This means in admin I just store a list of permitted domains, e.g.
youtube.com
photobucket.com
last.fm
myspace.comThis meets my usecase. Someone might want to make it "smarter", so you can choose whether the module cares about subdomains or not - at the moment my wholesale changes the way the module works, so bear this in mind and do not use it if you envisage wanting to only permit content from a particular subdomain (e.g. you want to permit vids.myspace.com but not viewmorepics.myspace.com) ...
| Attachment | Size |
|---|---|
| embedfilter.module.patch | 3.69 KB |

#1
Doing some changes to this. I'm actually writing the ability to use wildcards for subdomains and also an auto-resize feature. Watch this space.
#2
I haven't been able to make the changes I intended to, but I have made the original version more robust. See new, attached, replacement patch. You do *not* need to apply this on the other patch. It is a replacement!
#3
I like this idea and am committing it to the D6 port. I am not making any changes to the D5 version.
#4
Automatically closed -- issue fixed for 2 weeks with no activity.