$text = self::convertAttachment($text, $simple_html, $try_oembed);
}
+ $nosmile = strpos($text, '[nosmile]') !== false;
+ $text = str_replace('[nosmile]', '', $text);
+
+ // Replace non graphical smilies for external posts
+ if (!$nosmile && !$for_plaintext) {
+ $text = self::performWithEscapedTags($text, ['img'], function ($text) {
+ return Smilies::replace($text);
+ });
+ }
+
// leave open the posibility of [map=something]
// this is replaced in Item::prepareBody() which has knowledge of the item location
if (strpos($text, '[/map]') !== false) {
});
}
- // This is actually executed in Item::prepareBody()
-
- $nosmile = strpos($text, '[nosmile]') !== false;
- $text = str_replace('[nosmile]', '', $text);
-
// Check for font change text
$text = preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/sm", "<span style=\"font-family: $1;\">$2</span>", $text);
$text = preg_replace("/\[event\-id\](.*?)\[\/event\-id\]/ism", '', $text);
}
- // Replace non graphical smilies for external posts
- if (!$nosmile && !$for_plaintext) {
- $text = self::performWithEscapedTags($text, ['img'], function ($text) {
- return Smilies::replace($text);
- });
- }
-
if (!$for_plaintext && DI::config()->get('system', 'big_emojis') && ($simple_html != self::DIASPORA)) {
$conv = html_entity_decode(str_replace([' ', "\n", "\r"], '', $text));
// Emojis are always 4 byte Unicode characters
$hrefParts = parse_url($href);
- // Root path case (/path) including relative scheme case (//host/path)
- if ($hrefParts['path'] && $hrefParts['path'][0] == '/') {
- $path = $hrefParts['path'];
- } else {
- $path = $path . '/' . $hrefParts['path'];
-
- // Resolve arbitrary relative path
- // Lifted from https://www.php.net/manual/en/function.realpath.php#84012
- $parts = array_filter(explode('/', $path), 'strlen');
- $absolutes = array();
- foreach ($parts as $part) {
- if ('.' == $part) continue;
- if ('..' == $part) {
- array_pop($absolutes);
- } else {
- $absolutes[] = $part;
+ if (!empty($hrefParts['path'])) {
+ // Root path case (/path) including relative scheme case (//host/path)
+ if ($hrefParts['path'] && $hrefParts['path'][0] == '/') {
+ $path = $hrefParts['path'];
+ } else {
+ $path = $path . '/' . $hrefParts['path'];
+
+ // Resolve arbitrary relative path
+ // Lifted from https://www.php.net/manual/en/function.realpath.php#84012
+ $parts = array_filter(explode('/', $path), 'strlen');
+ $absolutes = array();
+ foreach ($parts as $part) {
+ if ('.' == $part) continue;
+ if ('..' == $part) {
+ array_pop($absolutes);
+ } else {
+ $absolutes[] = $part;
+ }
}
- }
- $path = '/' . implode('/', $absolutes);
+ $path = '/' . implode('/', $absolutes);
+ }
}
// Relative scheme case (//host/path)
use Friendica\Collection;
use Friendica\Database\Database;
use Friendica\Model;
-use Friendica\Model\Group;
use Friendica\Network\HTTPException;
use Friendica\Util\ACLFormatter;
use Psr\Log\LoggerInterface;
*/
public function selectByContactId($contact_id, $uid)
{
+ $cdata = Model\Contact::getPublicAndUserContacID($contact_id, $uid);
+ if (!empty($cdata)) {
+ $public_contact_str = '<' . $cdata['public'] . '>';
+ $user_contact_str = '<' . $cdata['user'] . '>';
+ $contact_id = $cdata['user'];
+ } else {
+ $public_contact_str = '<' . $contact_id . '>';
+ $user_contact_str = '';
+ }
+
$groups = [];
- if ($this->dba->exists('contact', ['id' => $contact_id, 'uid' => $uid, 'blocked' => false])) {
- $groups = Group::getIdsByContactId($contact_id);
+ if (!empty($user_contact_str) && $this->dba->exists('contact', ['id' => $contact_id, 'uid' => $uid, 'blocked' => false])) {
+ $groups = Model\Group::getIdsByContactId($contact_id);
}
$group_str = '<<>>'; // should be impossible to match
$group_str .= '|<' . preg_quote($group_id) . '>';
}
- $contact_str = '<' . $contact_id . '>';
-
- $condition = ["`uid` = ? AND (NOT (`deny_cid` REGEXP ? OR deny_gid REGEXP ?)
- AND (allow_cid REGEXP ? OR allow_gid REGEXP ? OR (allow_cid = '' AND allow_gid = '')))",
- $uid, $contact_str, $group_str, $contact_str, $group_str];
+ if (!empty($user_contact_str)) {
+ $condition = ["`uid` = ? AND (NOT (`deny_cid` REGEXP ? OR `deny_cid` REGEXP ? OR deny_gid REGEXP ?)
+ AND (allow_cid REGEXP ? OR allow_cid REGEXP ? OR allow_gid REGEXP ? OR (allow_cid = '' AND allow_gid = '')))",
+ $uid, $user_contact_str, $public_contact_str, $group_str,
+ $user_contact_str, $public_contact_str, $group_str];
+ } else {
+ $condition = ["`uid` = ? AND (NOT (`deny_cid` REGEXP ? OR deny_gid REGEXP ?)
+ AND (allow_cid REGEXP ? OR allow_gid REGEXP ? OR (allow_cid = '' AND allow_gid = '')))",
+ $uid, $public_contact_str, $group_str, $public_contact_str, $group_str];
+ }
return $this->select($condition);
}
#back-to-top {
display: none;
cursor: pointer;
- color: white;
+ color: $nav_icon_color;
position: fixed;
z-index: 49;
right: 20px;
font-size: 2.9em;
padding: 0 12px 0 12px;
border-radius: 10px;
- background-color: #aaa;
+ background-color: $nav_bg;
line-height: 1.5;
}
</div><!--row-->
</div><!-- container -->
- <div id="back-to-top" title="back to top">⇧</div>
+ <div id="back-to-top" title="back to top">⇪</div>
</main>
<footer>
</div><!--row-->
</div><!-- container -->
- <div id="back-to-top" title="back to top">⇧</div>
+ <div id="back-to-top" title="back to top">⇪</div>
</main>
<footer>
.fsuggest-content-wrapper,
.panel,
aside .widget,
-.nav-container .widget{
+.nav-container .widget,
+#back-to-top
+{
box-shadow: 0 0 3px $link_color;
-webkit-box-shadow: 0 0 3px $link_color;
}
input[type=text].tt-input {
box-shadow: none;
}
+
+#back-to-top {
+ color: $link_color;
+}
input[type=text].tt-input {
box-shadow: none;
}
+
+#back-to-top {
+ border: 1px solid $nav_icon_color;
+}