]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/jsonsearchresultslist.php
No more needed (for this fix) but maybe later. So I always only comment them out.
[quix0rs-gnu-social.git] / lib / jsonsearchresultslist.php
index 48540a4d587a56f76c8361ee7107efe147a9d74b..0f764a72be47e32905b195f99645bbc5cac90589 100644 (file)
@@ -232,14 +232,7 @@ class ResultItem
         $this->id           = $this->notice->id;
         $this->from_user_id = $this->profile->id;
 
-        $user = $this->profile->getUser();
-
-        if (empty($user)) {
-            // Gonna have to do till we can detect it
-            $this->iso_language_code = common_config('site', 'language');
-        } else {
-            $this->iso_language_code = $user->language;
-        }
+        $this->iso_language_code = Profile_prefs::getConfigData($this->profile, 'site', 'language');
         
         $this->source = $this->getSourceLink($this->notice->source);
 
@@ -271,7 +264,7 @@ class ResultItem
             break;
         default:
             $ns = Notice_source::getKV($source);
-            if ($ns) {
+            if ($ns instanceof Notice_source) {
                 $source_name = '<a href="' . $ns->url . '">' . $ns->name . '</a>';
             }
             break;