]> git.mxchange.org Git - friendica-addons.git/blobdiff - langfilter/langfilter.php
Logger Levels
[friendica-addons.git] / langfilter / langfilter.php
index b89c32dfeeb32b7e0d3c5f3aa882c5a23ac86762..6922ac82387cf5a1de16f62b93963098be149e49 100644 (file)
@@ -121,7 +121,7 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data)
 
        // Never filter own messages
        // TODO: find a better way to extract this
-       $logged_user_profile = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
+       $logged_user_profile = $a->getBaseURL() . '/profile/' . $a->user['nickname'];
        if ($logged_user_profile == $hook_data['item']['author-link']) {
                return;
        }
@@ -163,6 +163,10 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data)
                        break;
                }
 
+               if (empty($iso2)) {
+                       return;
+               }
+
                $lang = Text_LanguageDetect_ISO639::code2ToName($iso2);
        } else {
                $opts = $hook_data['item']['postopts'];