X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=9aca145988a91171a1b26bc43f57bf1f9f620cb2;hb=c506bb42a93be7bfe3d2066e60d08b87ba3275af;hp=d6b3ceeab40600ac1c7f54b452c7856c694eeebb;hpb=22d59350e958e24cc3b7c49ce8ceae2e3178576e;p=friendica.git diff --git a/include/text.php b/include/text.php old mode 100644 new mode 100755 index d6b3ceeab4..9aca145988 --- a/include/text.php +++ b/include/text.php @@ -426,6 +426,10 @@ function attribute_contains($attr,$s) { if(! function_exists('logger')) { function logger($msg,$level = 0) { + // turn off logger in install mode + global $a; + if ($a->module == 'install') return; + $debugging = get_config('system','debugging'); $loglevel = intval(get_config('system','loglevel')); $logfile = get_config('system','logfile'); @@ -674,7 +678,8 @@ function smilies($s) { $a = get_app(); $s = str_replace( - array( '<3', '</3', '<\\3', ':-)', ':)', ';-)', ':-(', ':(', ':-P', ':P', ':-"', ':-x', ':-X', ':-D', '8-|', '8-O', '\\o/', + array( '<3', '</3', '<\\3', ':-)', ':)', ';-)', ':-(', ':(', ':-P', ':P', ':-"', ':-x', ':-X', ':-D', '8-|', '8-O', '\\o/', 'o.O', 'O.o', '\\.../', '\\ooo/', + ':beer', ':homebrew', ':coffee', '~friendika', '~friendica', 'Diaspora*' ), array( '<3', @@ -694,6 +699,14 @@ function smilies($s) { '8-|', '8-O', '\\o/', + 'o.O', + 'O.o', + '\\.../', + '\\ooo/', + ':beer', + ':homebrew', + ':coffee', + '~friendika ~friendika', '~friendica ~friendica', 'DiasporaDiaspora*', @@ -940,6 +953,11 @@ function base64url_encode($s, $strip_padding = false) { function base64url_decode($s) { + if(is_array($s)) { + logger('base64url_decode: illegal input: ' . print_r(debug_backtrace(), true)); + return $s; + } + /* * // Placeholder for new rev of salmon which strips base64 padding. * // PHP base64_decode handles the un-padded input without requiring this step @@ -1059,3 +1077,37 @@ function array_xmlify($val){ if (is_array($val)) return array_map('array_xmlify', $val); return xmlify((string) $val); } + + +function reltoabs($text, $base) +{ + if (empty($base)) + return $text; + + $base = rtrim($base,'/'); + + $base2 = $base . "/"; + + // Replace links + $pattern = "/]*) href=\"(?!http|https|\/)([^\"]*)\"/"; + $replace = "