diff --git a/includes/processor_html_filter.inc b/includes/processor_html_filter.inc
index 0e714c3..da34fe5 100644
--- a/includes/processor_html_filter.inc
+++ b/includes/processor_html_filter.inc
@@ -122,10 +122,12 @@ class SearchApiHtmlFilter extends SearchApiAbstractProcessor {
       $text = substr($text, $pos + 1);
       preg_match('#^(/?)([-:_a-zA-Z]+)#', $text, $m);
       $text = substr($text, strpos($text, '>') + 1);
-      if ($m[1]) {
+      if (isset($m[1])) {
         // Closing tag.
-        if ($active_tag && $m[2] == $active_tag) {
-          return $ret;
+        if ($m[1]) {
+          if ($active_tag && $m[2] == $active_tag) {
+            return $ret;
+          }
         }
       }
       else {
