use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
-use Friendica\Core\Config;
use Friendica\Core\Hook;
-use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
public static function isLegacyMode()
{
if (is_null(self::$legacy_mode)) {
- self::$legacy_mode = (Config::get("system", "post_update_version") < 1279);
+ self::$legacy_mode = (DI::config()->get("system", "post_update_version") < 1279);
}
return self::$legacy_mode;
$uid = intval($item['uid']);
// check for create date and expire time
- $expire_interval = Config::get('system', 'dbclean-expire-days', 0);
+ $expire_interval = DI::config()->get('system', 'dbclean-expire-days', 0);
$user = DBA::selectFirst('user', ['expire'], ['uid' => $uid]);
if (DBA::isResult($user) && ($user['expire'] > 0) && (($user['expire'] < $expire_interval) || ($expire_interval == 0))) {
}
// Creates or assigns the permission set
- $item['psid'] = PermissionSet::fetchIDForPost($item);
+ $item['psid'] = PermissionSet::getIdFromACL(
+ $item['uid'],
+ $item['allow_cid'],
+ $item['allow_gid'],
+ $item['deny_cid'],
+ $item['deny_gid']
+ );
+
+ $item['allow_cid'] = null;
+ $item['allow_gid'] = null;
+ $item['deny_cid'] = null;
+ $item['deny_gid'] = null;
// We are doing this outside of the transaction to avoid timing problems
if (!self::insertActivity($item)) {
unset($item['owner-name']);
unset($item['owner-avatar']);
- $like_no_comment = Config::get('system', 'like_no_comment');
+ $like_no_comment = DI::config()->get('system', 'like_no_comment');
DBA::transaction();
$ret = DBA::insert('item', $item);
$URLSearchString = "^\[\]";
// All hashtags should point to the home server if "local_tags" is activated
- if (Config::get('system', 'local_tags')) {
+ if (DI::config()->get('system', 'local_tags')) {
$item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
"#[url=".DI::baseUrl()."/search?tag=$2]$2[/url]", $item["body"]);
$private = ($user['allow_cid'] || $user['allow_gid'] || $user['deny_cid'] || $user['deny_gid']) ? 1 : 0;
- $psid = PermissionSet::fetchIDForPost($user);
+ $psid = PermissionSet::getIdFromACL(
+ $user['uid'],
+ $user['allow_cid'],
+ $user['allow_gid'],
+ $user['deny_cid'],
+ $user['deny_gid']
+ );
$forum_mode = ($prvgroup ? 2 : 1);
*/
public static function fixPrivatePhotos($s, $uid, $item = null, $cid = 0)
{
- if (Config::get('system', 'disable_embedded')) {
+ if (DI::config()->get('system', 'disable_embedded')) {
return $s;
}
if ($rendered_hash == ''
|| $rendered_html == ""
|| $rendered_hash != hash("md5", $item["body"])
- || Config::get("system", "ignore_cache")
+ || DI::config()->get("system", "ignore_cache")
) {
self::addRedirToImageTags($item);
}
// Only compare the HTML when we forcefully ignore the cache
- if (Config::get("system", "ignore_cache") && ($rendered_html != $item["rendered-html"])) {
+ if (DI::config()->get("system", "ignore_cache") && ($rendered_html != $item["rendered-html"])) {
$update = true;
}
return $item_id;
}
- if (ActivityPub\Processor::fetchMissingActivity($uri)) {
- $item_id = self::searchByLink($uri, $uid);
+ if ($fetched_uri = ActivityPub\Processor::fetchMissingActivity($uri)) {
+ $item_id = self::searchByLink($fetched_uri, $uid);
} else {
$item_id = Diaspora::fetchByURL($uri);
}