X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=43b321e98a01f503ce960e8ae91e32b0eb3310c3;hb=091c3e75ca1303dda06d2b5434d4ca4623dc622b;hp=84195b0362bbdef7a52f17a51a2b8a0baeadfff3;hpb=992684c3620185da00663e25eb1460c4b18920ea;p=friendica.git diff --git a/include/text.php b/include/text.php index 84195b0362..43b321e98a 100644 --- a/include/text.php +++ b/include/text.php @@ -2,6 +2,7 @@ require_once("include/template_processor.php"); require_once("include/friendica_smarty.php"); +require_once("mod/proxy.php"); if(! function_exists('replace_macros')) { /** @@ -275,17 +276,17 @@ function paginate_data(&$a, $count=null) { $stripped = trim($stripped,'/'); $pagenum = $a->pager['page']; - if (($a->page_offset != "") AND !strstr($stripped, "&offset=")) + if (($a->page_offset != "") AND !preg_match('/[?&].offset=/', $stripped)) $stripped .= "&offset=".urlencode($a->page_offset); - if (!strpos($stripped, "?")) { - if ($pos = strpos($stripped, "&")) - $stripped = substr($stripped, 0, $pos)."?".substr($stripped, $pos + 1); - } $url = $a->get_baseurl() . '/' . $stripped; $data = array(); function _l(&$d, $name, $url, $text, $class="") { + if (!strpos($url, "?")) { + if ($pos = strpos($url, "&")) + $url = substr($url, 0, $pos)."?".substr($url, $pos + 1); + } $d[$name] = array('url'=>$url, 'text'=>$text, 'class'=>$class); } @@ -928,7 +929,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { . (($click) ? ' fakelink' : '') . '" ' . (($redir) ? ' target="redir" ' : '') . (($url) ? ' href="' . $url . '"' : '') . $click . ' >' . $contact['name']
+			. proxy_url($contact['micro']) . '' . "\r\n"; } }} @@ -1109,7 +1110,8 @@ function smilies($s, $sample = false) { ':like', ':dislike', '~friendica', - 'red#' + 'red#', + 'red#matrix' ); @@ -1147,7 +1149,8 @@ function smilies($s, $sample = false) { ':like', ':dislike', '~friendica ~friendica', - 'red red' + 'redredmatrix', + 'redredmatrix' ); $params = array('texts' => $texts, 'icons' => $icons, 'string' => $s); @@ -1330,8 +1333,7 @@ function prepare_body(&$item,$attach = false, $preview = false) { $item['mentions'] = $mentions; - //$cachefile = get_cachefile($item["guid"]."-".strtotime($item["edited"])."-".hash("crc32", $item['body'])); - $cachefile = get_cachefile($item["guid"]."-".hash("md5", $item['body'])); + $cachefile = get_cachefile(urlencode($item["guid"])."-".hash("md5", $item['body'])); if (($cachefile != '')) { if (file_exists($cachefile)) { @@ -1503,7 +1505,7 @@ function prepare_text($text) { else $s = smilies(bbcode($text)); - return $s; + return trim($s); }} @@ -2229,3 +2231,22 @@ function is_a_date_arg($s) { } return false; } + +/** + * remove intentation from a text + */ +function deindent($text, $chr="[\t ]", $count=NULL) { + $text = fix_mce_lf($text); + $lines = explode("\n", $text); + if (is_null($count)) { + $m = array(); + $k=0; while($k