diff --git a/noindex_external_links.info b/noindex_external_links.info
index 207d185..190c129 100644
--- a/noindex_external_links.info
+++ b/noindex_external_links.info
@@ -1,6 +1,7 @@
 name = Noindex External Links
-description = "Take control of indexing external links on your site."
-core = "6.x"
-project = "noindex_external_links"
+description = Take control of indexing external links on your site.
+core = 7.x
 package = SEO Tools
 
+files[] = noindex_external_links.module
+files[] = noindex_external_links.install
\ No newline at end of file
diff --git a/noindex_external_links.install b/noindex_external_links.install
index 20468c2..c0d9d24 100644
--- a/noindex_external_links.install
+++ b/noindex_external_links.install
@@ -5,7 +5,7 @@
 
 function noindex_external_links_install() {
   drupal_set_message(
-    t('Module Noindex External Links was installed.') .'<br />'. t('Site links is not protected yet.') .'<br />'. t('Visit !link and take control of your links indexing!', array('!link' => l(t('Noindex External Links Settings page'), 'admin/settings/noindex_external_links')))
+    st('Module Noindex External Links was installed.') . '<br />' . st('Site links is not protected yet.') . '<br />' . st('Visit !link and take control of your links indexing!', array('!link' => l(st('Noindex External Links Settings page'), 'admin/settings/noindex_external_links')))
   );
 }
 
diff --git a/noindex_external_links.module b/noindex_external_links.module
index dd49131..a51b617 100644
--- a/noindex_external_links.module
+++ b/noindex_external_links.module
@@ -3,13 +3,12 @@
  * @file
  */
 
-
-
 /**
- * Implementation of hook_menu()
+ * Implements hook_menu()
  */
 function noindex_external_links_menu() {
-  $items['admin/settings/noindex_external_links'] = array(
+  //$items['admin/config/content/noindex_external_links'] = array(
+  $items['admin/config/search/noindex_external_links'] = array(
     'title' => 'Noindex External Links',
     'description' => 'Take control of indexing external links on your site.',
     'page callback' => 'drupal_get_form',
@@ -22,10 +21,16 @@ function noindex_external_links_menu() {
 }
 
 /**
- * Implementation of hook_perm().
+ * Implements hook_permission().
  */
-function noindex_external_links_perm() {
-  return array('administer noindex external links');
+
+function noindex_external_links_permission() {
+  return array(
+    'administer noindex external links' => array(
+      'title' => t('Administer noindex external links'),
+      'description' => t('Perform maintenance tasks for noindex external links'),
+    )
+  );
 }
 
 /**
@@ -39,22 +44,22 @@ function noindex_external_links_settings_form() {
     '#description' => t('You can use any combination of this methods.'),
     '#default_value' => variable_get('noindex_external_links_method', array()),
     '#options' => array(
-      'noindex' => '<strong>'. t('Wrap links with tag') .' '. htmlentities('<NOINDEX>') .' </strong>. <br />'. t('NOINDEX tag is used to deny indexing part of page. Only Yandex and Rambler considers this tag but Google and others doesn\'t. There is also an attribute NOINDEX in meta-tag Robots.'),
+      'noindex' => '<strong> ' . t('Wrap links with tag') . ' ' . htmlentities('<NOINDEX>') . ' </strong>. <br />' . t('NOINDEX tag is used to deny indexing part of page. Only Yandex and Rambler considers this tag but Google and others doesn\'t. There is also an attribute NOINDEX in meta-tag Robots.'),
 
       'nofollow' => t('<strong>Add attribute rel="nofollow" to links</strong>. <br />This link\'s attribute has no effect on indexing. Only Google really do not follow this links but others do. Attribute is used to say to search engine that links no longer constitute a "vote" in the PageRank system.'),
     ),
   );
 
   $html_validation_link = array('!link' => l(t('HTML-validation'), 'http://validator.w3.org/'));
-
+  $filter_settings_link = array('!link' => l(t('Input formats page'), 'admin/settings/filter'));
   $form['noindex_external_links_noindex_format'] = array(
     '#type' => 'radios',
-    '#title' => htmlentities('<NOINDEX>') . t(' format'),
+    '#title' => htmlentities('<NOINDEX>') . t('format'),
     '#description' => t('If you want your pages be valid then use option "Valid".'),
     '#options' => array(
-      'simple' => '<strong>'. t('Simple') .'</strong>: '. htmlentities('<noindex>') .'<br />'. t('This is a default. NOINDEX-tag isn\'t a valid HTML-tag. It was created by Yandex and used also by Rambler. Google ignore this tag. HTML-validators considers this tag as mistake so your pages will not pass !link.', $html_validation_link),
+      'simple' => '<strong>' . t('Simple') . '</strong>: ' . htmlentities('<noindex>') . '<br />' . t('This is a default. NOINDEX-tag isn\'t a valid HTML-tag. It was created by Yandex and used also by Rambler. Google ignore this tag. HTML-validators considers this tag as mistake so your pages will not pass !link.', $html_validation_link),
 
-      'valid' => '<strong>'. t('Valid') .'</strong>: '. htmlentities('<span style="display: none"><![CDATA[<noindex>]]></span>') .'<br />'. t('Using this trick your pages will pass !link.', $html_validation_link) .'<br /><em><strong>'. t('NOTE') .'</strong>: '. t('You have to set "Noindex External Links filter" below "HTML-corrector filter" for all input formats you\'re using at the !link</em>.', array('!link' => l(t('Input formats page'), 'admin/settings/filters')) ),
+      'valid' => '<strong>' . t('Valid') . '</strong>: ' . htmlentities('<span style="display: none"><![CDATA[<noindex>]]></span>') . '<br />' . t('Using this trick your pages will pass !link.', $html_validation_link) . '<br /><em><strong>' . t('NOTE') . '</strong>: ' . t('You have to set "Noindex External Links filter" below "HTML-corrector filter" for all input formats you\'re using at the !link</em>.', $filter_settings_link),
     ),
     '#default_value' => variable_get('noindex_external_links_noindex_format', 'simple'),
   );
@@ -100,7 +105,7 @@ function noindex_external_links_settings_form() {
 }
 
 /**
- * Enter description here...
+ * Implements hook_help().
  *
  * @param string $section
  *   A Drupal path
@@ -110,13 +115,13 @@ function noindex_external_links_settings_form() {
 function noindex_external_links_help($path, $arg) {
   switch ($path) {
     case 'admin/help#noindex_external_links':
-      $output = '<p>'. t('Using this module you can control which external links will be indexed or/and followed by Search Engines. You can select a method of hidding depending on your prefered Search Engines. There are two lists of domains - one for always allowed and other for always denied domains.') .'</p>';
+      $output = '<p>' . t('Using this module you can control which external links will be indexed or/and followed by Search Engines. You can select a method of hidding depending on your prefered Search Engines. There are two lists of domains - one for always allowed and other for always denied domains.') . '</p>';
       return $output;
   }
 }
 
 /**
- * Implementation of hook_filter_tips()
+ * Implements filter tips callback
  *
  * @param int $delta
  *   Used when a module defines more than one filter
@@ -126,13 +131,14 @@ function noindex_external_links_help($path, $arg) {
  * @return string
  *   The tip to be displayed
  */
-function noindex_external_links_filter_tips($delta, $format, $long = FALSE) {
-  $output .= '<p>'. t('Search Engines will index and follow ONLY links to allowed domains.') ."</p>\n";
+
+function _external_links_tips($filter, $format, $long = FALSE) {
+  $output .= '<p>' . t('Search Engines will index and follow ONLY links to allowed domains.') . "</p>\n";
   return $output;
 }
 
 /**
- * Implementation of hook_filter. Defines a filter, "Noindex External Links filter".
+ * "Implements hook_filter_info. Defines a filter, "Noindex External Links filter".
  *
  * @param string $op
  * @param int $delta
@@ -141,13 +147,33 @@ function noindex_external_links_filter_tips($delta, $format, $long = FALSE) {
  *   The text to be filtered
  * @return string
  */
-function noindex_external_links_filter($op, $delta = 0, $format = -1, $text = '') {
+function noindex_external_links_filter_info() {
+  $filters['external_links'] = array(
+    'title' => t('Noindex External Links filter'),
+    'description' => t('ALinks will be wrapped with tag NOINDEX and will have attribute rel="nofollow" added to them.'),
+    'process callback' => '_external_links',
+    //'settings callback' => '_external_links_settings',
+    'tips callback'  => '_external_links_tips',
+    'cache' => FALSE,
+  );
+  return $filters;
+}
+
+function _noindex_external_links_item(&$item) {
+  $item = drupal_strtolower(trim($item));
+}
+
+function _external_links($text, $filter, $format) {
   global $_noindex_external_links_allowed_domains;
   global $_noindex_external_links_denied_domains;
   global $_noindex_external_links_method;
 
-  $_noindex_external_links_allowed_domains = split(',', variable_get('noindex_external_links_allowed_domains', ''));
-  $_noindex_external_links_denied_domains = split(',', variable_get('noindex_external_links_denied_domains', ''));
+  $_noindex_external_links_allowed_domains = preg_split("/[\s]*[,][\s]*/", trim(variable_get('noindex_external_links_allowed_domains')));
+  array_walk_recursive($_noindex_external_links_allowed_domains, '_noindex_external_links_item');
+
+  $_noindex_external_links_denied_domains = preg_split("/[\s]*[,][\s]*/", trim(variable_get('noindex_external_links_denied_domains')));
+  array_walk_recursive($_noindex_external_links_denied_domains, '_noindex_external_links_item');
+
   //Find domains in both lists:
   $ignored_domains = array_diff($_noindex_external_links_allowed_domains, $_noindex_external_links_denied_domains);
   if (count($ignored_domains)>0) {
@@ -156,16 +182,7 @@ function noindex_external_links_filter($op, $delta = 0, $format = -1, $text = ''
       unset($_noindex_external_links_denied_domains[$domain]);
     }
   }
-
-  switch ($op) {
-    case 'list':
-      return array(0 => t('Noindex External Links filter'));
-
-    case 'description':
-      return t('Links will be wrapped with tag NOINDEX and will have attribute rel="nofollow" added to them.');
-
-    case "process":
-      $_noindex_external_links_method = variable_get('noindex_external_links_method', array());
+    $_noindex_external_links_method = variable_get('noindex_external_links_method', array());
       if (count($_noindex_external_links_method)>0 || count($_noindex_external_links_denied_domains)>0) {
         //This regexp not found tags at links ancor:
         //$regexp = '/<a([^href]*)\shref="([^"]+)"\s*([^>]*)>([^<]+)<\/a>/i';
@@ -177,12 +194,10 @@ function noindex_external_links_filter($op, $delta = 0, $format = -1, $text = ''
         $text = preg_replace_callback($regexp, 'noindex_external_links_replace', $text);
       }
       return $text;
-
-    default:
-      return $text;
-  }
 }
 
+//function _external_links_settings($format) {
+//}
 
 /**
  * Do the magic with links
@@ -197,30 +212,31 @@ function noindex_external_links_replace($match) {
   global $_noindex_external_links_method;
 
   $url = parse_url($match[2]);
-  if ($url['host'] == $_SERVER['HTTP_HOST'])  return $match[0]; //Inner Link
+  $url_host = drupal_strtolower(trim($url['host']));
+  if (strcasecmp($url_host, $_SERVER['HTTP_HOST']) == 0)  return $match[0]; //Inner Link
 
-//  drupal_set_message('Process link: '. $match[0]);
-//  watchdog('noindex_external_links', 'Process link: '. $match[0]);
+  //  drupal_set_message('Process link: '. $match[0]);
+  //  watchdog('noindex_external_links', 'Process link: '. $match[0]);
 
   // Default in case it doesn't get changed.
   $link = $match[0];
 
   //ToDo: Можно принудительно удалять noindex,nofollow...
-  if (in_array($url['host'], $_noindex_external_links_allowed_domains))  return $link;
-  elseif (count($_noindex_external_links_method)<1 && !in_array($url['host'], $_noindex_external_links_denied_domains))  return $link;
+  if (in_array($url_host, $_noindex_external_links_allowed_domains))  return $link;
+  elseif (count($_noindex_external_links_method)<1 && !in_array($url_host, $_noindex_external_links_denied_domains))  return $link;
   else {
     //Combine all attributes:
-    $attr = $match[1] .' '. $match[3];
-    if ($_noindex_external_links_method['nofollow'] || in_array($url['host'], $_noindex_external_links_denied_domains)) {
+    $attr = $match[1] . ' ' . $match[3];
+    if ($_noindex_external_links_method['nofollow'] || in_array($url_host, $_noindex_external_links_denied_domains)) {
       if (strpos($attr, 'nofollow') === FALSE) {
-        if (strpos($attr, 'rel="') === FALSE)     $attr = $attr .' rel="nofollow" ';
+        if (strpos($attr, 'rel="') === FALSE)     $attr = $attr . ' rel="nofollow" ';
         else    $attr = preg_replace('!rel="([^"]+)"!', 'rel="${1} nofollow"', $attr);
       }
     }
 
-    $link = '<a href="'. $match[2] .'" '. $attr .'>'. $match[4] .'</a>';
+    $link = '<a href="' . $match[2] . '" ' . $attr . '>' . $match[4] . '</a>';
 
-    if ($_noindex_external_links_method['noindex'] || in_array($url['host'], $_noindex_external_links_denied_domains)) {
+    if ($_noindex_external_links_method['noindex'] || in_array($url_host, $_noindex_external_links_denied_domains)) {
       // Build a new link:
       if (variable_get('noindex_external_links_noindex_format', 'simple') == 'valid') {
         $link = '<span style="display: none"><![CDATA[<noindex>]]></span>'.$link.'<span style="display: none"><![CDATA[</noindex>]]></span>';
