Index: embedfilter.module
===================================================================
--- embedfilter.module	(revision 83)
+++ embedfilter.module	(revision 85)
@@ -38,8 +38,8 @@
 </pre>
 EOF;
 
-      $output .= '<p>'. t('To use this moudule, start by entering a number of hosts that you wish to allow. This is done from the <a href="/?q=admin/settings/embedfilter">settings page</a>. Examples taken from the sites mentioned above would be: <ul><li>http://www.youtube.com</li><li>http://www.ifilm.com</li><li>http://media.nowpublic.com</li></ul> Note that variants on a host, such as <code>http://www.youtube.com</code> and <code>http://youtube.com</code> must be entered individually.From the settings page you can also define some HTML that will be embedded before and after any tags (in case you want to be able to visually identify them on your site), as well as some filter tip instructions to your users.') .'</p>';
-      $output .= '<p>'. t('After you have configured the module from the settings page, you need to add the "Object and embed" filter to the appropriate input formats (such as "Filtered HTML") on the <a href="/?q=admin/filters">input formats</a> administration page. Configure your HTML filter to accept &lt;object>, &lt;embed> and &lt;script> tags by adding them to the list of accepted tags. Configure the order of the filters so that the "Object and embed tag" filter comes directly after the "HTML" filter. After this you should be ready to go!'). '</p>';
+      $output .= '<p>'. t('To use this module, start by entering a number of hosts that you wish to allow. This is done from the <a href="/?q=admin/settings/embedfilter">settings page</a>. Examples taken from the sites mentioned above would be: <ul><li>youtube.com</li><li>ifilm.com</li><li>nowpublic.com</li></ul> You can define some HTML that will be embedded before and after any tags (in case you want to be able to visually identify them on your site), as well as some filter tip instructions to your users.') .'</p>';
+      $output .= '<p>'. t('After you have configured the module from the settings page, you need to add the "Object and embed" filter to the appropriate input formats (such as "Filtered HTML") on the <a href="/?q=admin/filters">input formats</a> administration page. Configure your HTML filter to accept &lt;object>, &lt;embed>, &lt;param> and &lt;script> tags by adding them to the list of accepted tags. Configure the order of the filters so that the "Object and embed tag" filter comes directly after the "HTML" filter. After this you should be ready to go!'). '</p>';
       return $output;
   }
 }
@@ -73,7 +73,7 @@
     '#type' => 'textarea',
     '#title' => t('Allowed hosts'),
     '#default_value' => variable_get('embedfilter_host_whitelist', "http://www.youtube.com\nhttp://media.nowpublic.com"),
-    '#description' => t('Each host name or base URL from which <object>, <embed> or <script> tags should be accepted. One URL per line. Make sure to match the URL exactly (for instance, http://www.example.com and http://example.com will be seen as different URLs). Example: http://www.youtube.com'),
+    '#description' => t('Each host name from which &lt;object>, &lt;embed>, &lt;param> or &lt;script> tags should be accepted. One host per line. This module is patched to expect only domain.tld format and ignores subdomains. Example: youtube.com'),
   );
 
   $form['extramarkup'] = array(
@@ -249,7 +249,7 @@
   preg_match_all($pattern, $input, $matches);
   foreach ($matches[3] as $url) {
     $parts = parse_url($url);
-    if (!in_array($parts['scheme']. '://'. $parts['host'], embedfilter_get_whitelist())) {
+    if (!in_array(preg_replace('!^[^.]*\\.!','', $parts['host']), embedfilter_get_whitelist())) {
       return false;
     }
   }
