]> git.wh0rd.org - tt-rss.git/commitdiff
fix language detection; remove f_guid debugging
authorAndrew Dolgov <noreply@fakecake.org>
Tue, 19 Aug 2014 06:18:32 +0000 (10:18 +0400)
committerAndrew Dolgov <noreply@fakecake.org>
Tue, 19 Aug 2014 06:18:32 +0000 (10:18 +0400)
include/rssfuncs.php

index baf0cab06b5585d48b1a9d8a582af660f942927c..d6e5a54436725e1352bc80f4ffee23efc637af1b 100644 (file)
                                $entry_guid = $item->get_id();
                                if (!$entry_guid) $entry_guid = $item->get_link();
                                if (!$entry_guid) $entry_guid = make_guid_from_title($item->get_title());
-
-                               _debug("f_guid $entry_guid", $debug_enabled);
-
                                if (!$entry_guid) continue;
 
                                $entry_guid = "$owner_uid,$entry_guid";
                                        $entry_language = $lang->detect($entry_title . " " . $entry_content, 1);
 
                                        if (count($entry_language) > 0) {
-                                               $entry_language = array_keys($entry_language);
-
-                                               // the fuck?
-                                               if (is_array($entry_language))
-                                                       $entry_language = "";
-                                               else
-                                                       $entry_language = db_escape_string(substr($entry_language[0], 0, 2));
+                                               @$entry_language = array_keys($entry_language)[0];
 
                                                _debug("detected language: $entry_language", $debug_enabled);
                                        } else {