X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fdisplay.php;h=ca6809eba14c6fb9b34c359d2f4db172ce83417f;hb=74479c4020499e6aa7866b5478366932b723c515;hp=8d1a44e4be18718a081fc6de6351ccd0cb75aa82;hpb=63610c7b73fcaf862adbf880d4968dd2b1678d9b;p=friendica.git diff --git a/mod/display.php b/mod/display.php index 8d1a44e4be..ca6809eba1 100644 --- a/mod/display.php +++ b/mod/display.php @@ -1,6 +1,8 @@ get_baseurl()))) { - $nickname = str_replace(normalise_link($a->get_baseurl())."/profile/", "", normalise_link($profiledata["url"])); + if (strstr(normalise_link($profiledata["url"]), normalise_link(App::get_baseurl()))) { + $nickname = str_replace(normalise_link(App::get_baseurl())."/profile/", "", normalise_link($profiledata["url"])); if (($nickname != $a->user["nickname"])) { $r = qu("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile` @@ -106,7 +108,6 @@ function display_init(&$a) { } profile_load($a, $nick, 0, $profiledata); - } function display_fetchauthor($a, $item) { @@ -184,7 +185,7 @@ function display_fetchauthor($a, $item) { if (local_user()) { if (in_array($profiledata["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) { - $profiledata["remoteconnect"] = $a->get_baseurl()."/follow?url=".urlencode($profiledata["url"]); + $profiledata["remoteconnect"] = App::get_baseurl()."/follow?url=".urlencode($profiledata["url"]); } } elseif ($profiledata["network"] == NETWORK_DFRN) { $connect = str_replace("/profile/", "/dfrn_request/", $profiledata["url"]); @@ -194,7 +195,7 @@ function display_fetchauthor($a, $item) { return($profiledata); } -function display_content(&$a, $update = 0) { +function display_content(App $a, $update = 0) { if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { notice(t('Public access denied.') . EOL); @@ -303,7 +304,7 @@ function display_content(&$a, $update = 0) { intval($contact_id), intval($a->profile['uid']) ); - if(dbm::is_result($r)) { + if (dbm::is_result($r)) { $contact = $r[0]; $remote_contact = true; } @@ -319,7 +320,7 @@ function display_content(&$a, $update = 0) { $r = qu("SELECT * FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1", intval($a->profile['uid']) ); - if(dbm::is_result($r)) { + if (dbm::is_result($r)) { $a->page_contact = $r[0]; } $is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false); @@ -420,11 +421,17 @@ function display_content(&$a, $update = 0) { $title = trim(html2plain(bbcode($r[0]["title"], false, false), 0, true)); $author_name = $r[0]["author-name"]; - $image = $a->remove_baseurl($r[0]["thumb"]); + $image = $a->remove_baseurl($r[0]["author-thumb"]); if ($title == "") { $title = $author_name; } + + // Limit the description to 160 characters + if (strlen($description) > 160) { + $description = substr($description, 0, 157) . '...'; + } + $description = htmlspecialchars($description, ENT_COMPAT, 'UTF-8', true); // allow double encoding here $title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8', true); // allow double encoding here $author_name = htmlspecialchars($author_name, ENT_COMPAT, 'UTF-8', true); // allow double encoding here