X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=3783d2accd9dbbce3d8bdf3fac9056d7897c98e4;hb=f433158bedee99dd52c47c35e8e19e601027da11;hp=bfa832425decac31a1ebc122c0fc60c33f04f087;hpb=43d986cab2dd7543f17ecb4719a13f7310f14e37;p=friendica.git diff --git a/include/text.php b/include/text.php index bfa832425d..3783d2accd 100644 --- a/include/text.php +++ b/include/text.php @@ -70,7 +70,7 @@ function notags($string) { if(! function_exists('escape_tags')) { function escape_tags($string) { - return(htmlspecialchars($string)); + return(htmlspecialchars($string, ENT_COMPAT, 'UTF-8', false)); }} @@ -403,7 +403,7 @@ function load_view_file($s) { return file_get_contents("$d/$lang/$b"); $theme = current_theme(); - + if(file_exists("$d/theme/$theme/$b")) return file_get_contents("$d/theme/$theme/$b"); @@ -504,6 +504,10 @@ function get_tags($s) { $s = preg_replace('/\[code\](.*?)\[\/code\]/sm','',$s); + // ignore anything in a bbtag + + $s = preg_replace('/\[(.*?)\]/sm','',$s); + // Match full names against @tags including the space between first and last // We will look these up afterward to see if they are full names or not recognisable. @@ -723,6 +727,39 @@ function get_poke_verbs() { return $arr; } +function get_mood_verbs() { + + // index is present tense verb + // value is array containing past tense verb, translation of present, translation of past + + $arr = array( + 'happy' => t('happy'), + 'sad' => t('sad'), + 'mellow' => t('mellow'), + 'tired' => t('tired'), + 'perky' => t('perky'), + 'angry' => t('angry'), + 'stupefied' => t('stupified'), + 'puzzled' => t('puzzled'), + 'interested' => t('interested'), + 'bitter' => t('bitter'), + 'cheerful' => t('cheerful'), + 'alive' => t('alive'), + 'annoyed' => t('annoyed'), + 'anxious' => t('anxious'), + 'cranky' => t('cranky'), + 'disturbed' => t('disturbed'), + 'frustrated' => t('frustrated'), + 'motivated' => t('motivated'), + 'relaxed' => t('relaxed'), + 'surprised' => t('surprised'), + ); + + call_hooks('mood_verbs', $arr); + return $arr; +} + + /** * * Function: smilies @@ -1578,7 +1615,7 @@ function undo_post_tagging($s) { function fix_mce_lf($s) { $s = str_replace("\r\n","\n",$s); - $s = str_replace("\n\n","\n",$s); +// $s = str_replace("\n\n","\n",$s); return $s; }