aboutsummaryrefslogtreecommitdiffstats
path: root/include/language.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-05-21 17:23:34 -0700
committerfriendica <info@friendica.com>2014-05-21 17:23:34 -0700
commitd17768d4e7b7f07dfd2f4326f79fa8b1f9a74582 (patch)
tree1cb7bf698e713a4a784a579c4dd6db9d7b00167c /include/language.php
parenta6602a9871a918702a5ccbcae121920cf959129c (diff)
downloadvolse-hubzilla-d17768d4e7b7f07dfd2f4326f79fa8b1f9a74582.tar.gz
volse-hubzilla-d17768d4e7b7f07dfd2f4326f79fa8b1f9a74582.tar.bz2
volse-hubzilla-d17768d4e7b7f07dfd2f4326f79fa8b1f9a74582.zip
change app dropdown to point to apps module (changes nav template). Important: Plugins using the app-menu hook will no longer be accessible from there and may require re-writing to plug into the system apps page. Also filter apps in items from the language detector to avoid false triggers from the base64 content.
Diffstat (limited to 'include/language.php')
-rw-r--r--include/language.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/language.php b/include/language.php
index 780dfadba..cfaa855dd 100644
--- a/include/language.php
+++ b/include/language.php
@@ -214,8 +214,10 @@ function detect_language($s) {
if($min_confidence === false)
$min_confidence = LANGUAGE_DETECT_MIN_CONFIDENCE;
+ // embedded apps have long base64 strings which will trip up the detector.
+ $naked_body = preg_replace('/\[app\](.*?)\[\/app\]/','',$s);
// strip off bbcode
- $naked_body = preg_replace('/\[(.+?)\]/', '', $s);
+ $naked_body = preg_replace('/\[(.+?)\]/', '', $naked_body);
if(mb_strlen($naked_body) < intval($min_length)) {
logger('detect language: string length less than ' . intval($min_length), LOGGER_DATA);
return '';