Patch for ignoring subdomains

greg.harvey - February 6, 2008 - 16:20
Project:Embed filter
Version:5.x-1.0
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.com

This 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) ...

AttachmentSize
embedfilter.module.patch3.69 KB

#1

greg.harvey - February 6, 2008 - 19:37

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

greg.harvey - February 7, 2008 - 18:25

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!

AttachmentSize
embedfilter.module.patch 5.74 KB

#3

KarenS - September 27, 2009 - 10:56
Status:needs review» fixed

I like this idea and am committing it to the D6 port. I am not making any changes to the D5 version.

#4

System Message - October 11, 2009 - 11:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.