X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fitem.php;h=a2b88a8e305f00474a3adecb034adb5a6ed71ddf;hb=25e2a849c4cb82c7188f1cd5bcf4c4fb97dadcaa;hp=d203ce64d497bc977666c77e36b4de4b1c53932f;hpb=e224e12cb9f62bf08c94c4e072fa511206cc7d12;p=friendica.git diff --git a/mod/item.php b/mod/item.php index d203ce64d4..a2b88a8e30 100644 --- a/mod/item.php +++ b/mod/item.php @@ -18,7 +18,6 @@ require_once('include/crypto.php'); require_once('include/enotify.php'); require_once('include/email.php'); -require_once('library/langdet/Text/LanguageDetect.php'); require_once('include/tags.php'); require_once('include/files.php'); require_once('include/threads.php'); @@ -268,32 +267,8 @@ function item_post(&$a) { $guid = get_guid(32); - $naked_body = preg_replace('/\[(.+?)\]/','',$body); - - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { - $l = new Text_LanguageDetect; - //$lng = $l->detectConfidence($naked_body); - //$postopts = (($lng['language']) ? 'lang=' . $lng['language'] . ';' . $lng['confidence'] : ''); - - $lng = $l->detect($naked_body, 3); - - if (sizeof($lng) > 0) { - $postopts = ""; - - foreach ($lng as $language => $score) { - if ($postopts == "") - $postopts = "lang="; - else - $postopts .= ":"; - - $postopts .= $language.";".$score; - } - } - - logger('mod_item: detect language' . print_r($lng,true) . $naked_body, LOGGER_DATA); - } - else - $postopts = ''; + item_add_language_opt($_REQUEST); + $postopts = $_REQUEST['postopts'] ? $_REQUEST['postopts'] : ""; $private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0); @@ -387,8 +362,7 @@ function item_post(&$a) { if((local_user()) && (local_user() == $profile_uid)) { $self = true; $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1", - intval($_SESSION['uid']) - ); + intval($_SESSION['uid'])); } elseif(remote_user()) { if(is_array($_SESSION['remote'])) {