`info` mediumtext COMMENT '',
`notify_new_posts` boolean NOT NULL DEFAULT '0' COMMENT '',
`fetch_further_information` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
- `ffi_keyword_denylist` text COMMENT '',
+ `ffi_keyword_blacklist` text COMMENT '',
`photo` varbinary(383) DEFAULT '' COMMENT 'Link to the profile photo of the contact',
`thumb` varbinary(383) DEFAULT '' COMMENT 'Link to the profile photo (thumb size)',
`micro` varbinary(383) DEFAULT '' COMMENT 'Link to the profile photo (micro size)',
`notify_new_posts` boolean COMMENT '',
`remote_self` tinyint unsigned COMMENT '0 => No mirroring, 1-2 => Mirror as own post, 3 => Mirror as reshare',
`fetch_further_information` tinyint unsigned COMMENT '0 => None, 1 => Fetch information, 3 => Fetch keywords, 2 => Fetch both',
- `ffi_keyword_denylist` text COMMENT '',
+ `ffi_keyword_blacklist` text COMMENT '',
`subhub` boolean COMMENT '',
`hub-verify` varbinary(383) COMMENT '',
`protocol` char(4) COMMENT 'Protocol of the contact',
`contact`.`bd` AS `bd`,
`contact`.`notify_new_posts` AS `notify_new_posts`,
`contact`.`fetch_further_information` AS `fetch_further_information`,
- `contact`.`ffi_keyword_denylist` AS `ffi_keyword_denylist`,
+ `contact`.`ffi_keyword_blacklist` AS `ffi_keyword_blacklist`,
`user`.`parent-uid` AS `parent-uid`,
`user`.`guid` AS `guid`,
`user`.`nickname` AS `nickname`,
`ucontact`.`deleted` AS `deleted`,
`ucontact`.`notify_new_posts` AS `notify_new_posts`,
`ucontact`.`fetch_further_information` AS `fetch_further_information`,
- `ucontact`.`ffi_keyword_denylist` AS `ffi_keyword_denylist`,
+ `ucontact`.`ffi_keyword_blacklist` AS `ffi_keyword_blacklist`,
`ucontact`.`rating` AS `rating`,
`ucontact`.`readonly` AS `readonly`,
`ucontact`.`blocked` AS `blocked`,
| info | | mediumtext | YES | | NULL | |
| notify_new_posts | | boolean | NO | | 0 | |
| fetch_further_information | | tinyint unsigned | NO | | 0 | |
-| ffi_keyword_denylist | | text | YES | | NULL | |
+| ffi_keyword_blacklist | | text | YES | | NULL | |
| photo | Link to the profile photo of the contact | varbinary(383) | YES | | | |
| thumb | Link to the profile photo (thumb size) | varbinary(383) | YES | | | |
| micro | Link to the profile photo (micro size) | varbinary(383) | YES | | | |
| profile-id | Deprecated | int unsigned | YES | | NULL | |
Indexes
-------------
+-------
| Name | Fields |
| --------------------------- | ------------------------------------ |
| notify_new_posts | | boolean | YES | | NULL | |
| remote_self | 0 => No mirroring, 1-2 => Mirror as own post, 3 => Mirror as reshare | tinyint unsigned | YES | | NULL | |
| fetch_further_information | 0 => None, 1 => Fetch information, 3 => Fetch keywords, 2 => Fetch both | tinyint unsigned | YES | | NULL | |
-| ffi_keyword_denylist | | text | YES | | NULL | |
+| ffi_keyword_blacklist | | text | YES | | NULL | |
| subhub | | boolean | YES | | NULL | |
| hub-verify | | varbinary(383) | YES | | NULL | |
| protocol | Protocol of the contact | char(4) | YES | | NULL | |
* @property-read bool $notifyNewPosts
* @property-read int $remoteSelf
* @property-read int $fetchFurtherInformation
- * @property-read string $ffiKeywordDenylist
+ * @property-read string $ffiKeywordblacklist
* @property-read bool $subhub
* @property-read string $hubVerify
* @property-read string $protocol
/** @var int One of FFI_* */
protected $fetchFurtherInformation;
/** @var string */
- protected $ffiKeywordDenylist;
+ protected $ffiKeywordblacklist;
/** @var bool */
protected $subhub;
/** @var string */
/** @var int */
protected $priority;
- public function __construct(int $userId, int $contactId, bool $blocked = false, bool $ignored = false, bool $collapsed = false, bool $hidden = false, bool $pending = false, int $rel = Contact::NOTHING, string $info = '', bool $notifyNewPosts = false, int $remoteSelf = self::MIRROR_DEACTIVATED, int $fetchFurtherInformation = self::FFI_NONE, string $ffiKeywordDenylist = '', bool $subhub = false, string $hubVerify = '', string $protocol = Protocol::PHANTOM, ?int $rating = null, ?int $priority = null)
+ public function __construct(int $userId, int $contactId, bool $blocked = false, bool $ignored = false, bool $collapsed = false, bool $hidden = false, bool $pending = false, int $rel = Contact::NOTHING, string $info = '', bool $notifyNewPosts = false, bool $isRemoteSelf = false, int $fetchFurtherInformation = 0, string $ffiKeywordblacklist = '', bool $subhub = false, string $hubVerify = '', string $protocol = Protocol::PHANTOM, ?int $rating = null, ?int $priority = null)
{
$this->userId = $userId;
$this->contactId = $contactId;
$this->notifyNewPosts = $notifyNewPosts;
$this->remoteSelf = $remoteSelf;
$this->fetchFurtherInformation = $fetchFurtherInformation;
- $this->ffiKeywordDenylist = $ffiKeywordDenylist;
+ $this->ffiKeywordblacklist = $ffiKeywordblacklist;
$this->subhub = $subhub;
$this->hubVerify = $hubVerify;
$this->protocol = $protocol;
$row['notify_new_posts'] ?? false,
$row['remote_self'] ?? Entity\LocalRelationship::MIRROR_DEACTIVATED,
$row['fetch_further_information'] ?? Entity\LocalRelationship::FFI_NONE,
- $row['ffi_keyword_denylist'] ?? '',
+ $row['ffi_keyword_blacklist'] ?? '',
$row['subhub'] ?? false,
$row['hub-verify'] ?? '',
$row['protocol'] ?? Protocol::PHANTOM,
'notify_new_posts' => $localRelationship->notifyNewPosts,
'remote_self' => $localRelationship->remoteSelf,
'fetch_further_information' => $localRelationship->fetchFurtherInformation,
- 'ffi_keyword_denylist' => $localRelationship->ffiKeywordDenylist,
+ 'ffi_keyword_blacklist' => $localRelationship->ffiKeywordblacklist,
'subhub' => $localRelationship->subhub,
'hub-verify' => $localRelationship->hubVerify,
'protocol' => $localRelationship->protocol,
* @param bool $no_photos
* @param string $photo
* @param bool $keywords
- * @param string $keyword_denylist
+ * @param string $keyword_blacklist
* @return string
* @throws HTTPException\InternalServerErrorException
*/
- public static function getFooterFromUrl(string $url, bool $no_photos = false, string $photo = '', bool $keywords = false, string $keyword_denylist = ''): string
+ public static function getFooterFromUrl(string $url, bool $no_photos = false, string $photo = '', bool $keywords = false, string $keyword_blacklist = ''): string
{
- $data = self::queryUrl($url, $photo, $keywords, $keyword_denylist);
+ $data = self::queryUrl($url, $photo, $keywords, $keyword_blacklist);
return self::getFooterFromData($data, $no_photos);
}
* @param string $url
* @param string $photo
* @param bool $keywords
- * @param string $keyword_denylist
+ * @param string $keyword_blacklist
* @return array|bool
* @throws HTTPException\InternalServerErrorException
*/
- public static function queryUrl(string $url, string $photo = '', bool $keywords = false, string $keyword_denylist = '')
+ public static function queryUrl(string $url, string $photo = '', bool $keywords = false, string $keyword_blacklist = '')
{
$data = ParseUrl::getSiteinfoCached($url);
if (!$keywords) {
unset($data['keywords']);
- } elseif ($keyword_denylist && !empty($data['keywords'])) {
- $list = explode(', ', $keyword_denylist);
+ } elseif ($keyword_blacklist && !empty($data['keywords'])) {
+ $list = explode(', ', $keyword_blacklist);
foreach ($list as $keyword) {
$keyword = trim($keyword);
/**
* @param string $url
* @param string $photo
- * @param string $keyword_denylist
+ * @param string $keyword_blacklist
* @return array
* @throws HTTPException\InternalServerErrorException
*/
- public static function getTagsFromUrl(string $url, string $photo = '', string $keyword_denylist = ''): array
+ public static function getTagsFromUrl(string $url, string $photo = '', string $keyword_blacklist = ''): array
{
- $data = self::queryUrl($url, $photo, true, $keyword_denylist);
+ $data = self::queryUrl($url, $photo, true, $keyword_blacklist);
if (empty($data['keywords'])) {
return [];
$text
);
- // sanitize href attributes (only allowlisted protocols URLs)
+ // sanitize href attributes (only whitelisted protocols URLs)
// default value for backward compatibility
$allowed_link_protocols = DI::config()->get('system', 'allowed_link_protocols', []);
}
// Don't explain an explain statement
- if (strtolower(substr($query, 0, 7)) == "explain") {
+ if (strtolower(substr($query, 0, 7)) == 'explain') {
return;
}
// Only do the explain on "select", "update" and "delete"
- if (!in_array(strtolower(substr($query, 0, 6)), ["select", "update", "delete"])) {
+ if (!in_array(strtolower(substr($query, 0, 6)), ['select', 'update', 'delete'])) {
return;
}
- $r = $this->p("EXPLAIN " . $query);
+ $r = $this->p('EXPLAIN ' . $query);
if (!$this->isResult($r)) {
return;
}
$watchlist = explode(',', $this->config->get('system', 'db_log_index_watch'));
- $denylist = explode(',', $this->config->get('system', 'db_log_index_denylist'));
+ $blacklist = explode(',', $this->config->get('system', 'db_log_index_blacklist'));
while ($row = $this->fetch($r)) {
if ((intval($this->config->get('system', 'db_loglimit_index')) > 0)) {
$log = true;
}
- if (in_array($row['key'], $denylist) || ($row['key'] == "")) {
+ if (in_array($row['key'], $blacklist) || ($row['key'] == '')) {
$log = false;
}
$this->config->get('system', 'db_log_index'),
DateTimeFormat::utcNow() . "\t" .
$row['key'] . "\t" . $row['rows'] . "\t" . $row['Extra'] . "\t" .
- basename($backtrace[1]["file"]) . "\t" .
- $backtrace[1]["line"] . "\t" . $backtrace[2]["function"] . "\t" .
+ basename($backtrace[1]['file']) . "\t" .
+ $backtrace[1]['line'] . "\t" . $backtrace[2]['function'] . "\t" .
substr($query, 0, 4000) . "\n",
FILE_APPEND
);
}
/**
- * Removes every not allowlisted character from the identifier string
+ * Removes every not whitelisted character from the identifier string
*
* @param string $identifier
* @return string sanitized identifier
$fields['remote_self'] = intval($_POST['remote_self']);
}
- if (isset($_POST['ffi_keyword_denylist'])) {
- $fields['ffi_keyword_denylist'] = $_POST['ffi_keyword_denylist'];
+ if (isset($_POST['ffi_keyword_blacklist'])) {
+ $fields['ffi_keyword_blacklist'] = $_POST['ffi_keyword_blacklist'];
}
if (isset($_POST['poll'])) {
'$hidden' => ['hidden', $this->t('Hide this contact from others'), $localRelationship->hidden, $this->t('Replies/likes to your public posts <strong>may</strong> still be visible')],
'$notify_new_posts' => ['notify_new_posts', $this->t('Notification for new posts'), ($localRelationship->notifyNewPosts), $this->t('Send a notification of every new post of this contact')],
'$fetch_further_information' => $fetch_further_information,
- '$ffi_keyword_denylist' => ['ffi_keyword_denylist', $this->t('Keyword Deny List'), $localRelationship->ffiKeywordDenylist, $this->t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')],
+ '$ffi_keyword_blacklist' => ['ffi_keyword_blacklist', $this->t('Keyword Deny List'), $localRelationship->ffiKeywordblacklist, $this->t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')],
'$photo' => Contact::getPhoto($contact),
'$name' => $contact['name'],
'$sparkle' => $sparkle,
$data = PageInfo::queryUrl(
$item['plink'],
false,
- $fetch_further_information == LocalRelationship::FFI_BOTH,
- $contact['ffi_keyword_denylist'] ?? ''
+ $preview,
+ ($contact['fetch_further_information'] == 2),
+ $contact['ffi_keyword_blacklist'] ?? ''
);
if (!empty($data)) {
// We always strip the title since it will be added in the page information
$item['title'] = '';
$item['body'] = $item['body'] . "\n" . PageInfo::getFooterFromData($data, false);
- $taglist = $fetch_further_information == LocalRelationship::FFI_BOTH ? PageInfo::getTagsFromUrl($item['plink'], $preview, $contact['ffi_keyword_denylist'] ?? '') : [];
+ $taglist = $contact['fetch_further_information'] == 2 ? PageInfo::getTagsFromUrl($item['plink'], $preview, $contact['ffi_keyword_blacklist'] ?? '') : [];
$item['object-type'] = Activity\ObjectType::BOOKMARK;
$attachments = [];
if ($fetch_further_information == LocalRelationship::FFI_KEYWORD) {
if (empty($taglist)) {
- $taglist = PageInfo::getTagsFromUrl($item['plink'], $preview, $contact['ffi_keyword_denylist'] ?? '');
+ $taglist = PageInfo::getTagsFromUrl($item['plink'], $preview, $contact['ffi_keyword_blacklist'] ?? '');
}
$item['body'] .= "\n" . self::tagToString($taglist);
} else {
private static function mergePersonalContacts(int $first, int $duplicate)
{
$fields = ['self', 'remote_self', 'rel', 'prvkey', 'subhub', 'hub-verify', 'priority', 'writable', 'archive', 'pending',
- 'rating', 'notify_new_posts', 'fetch_further_information', 'ffi_keyword_denylist', 'block_reason'];
+ 'rating', 'notify_new_posts', 'fetch_further_information', 'ffi_keyword_blacklist', 'block_reason'];
$c1 = Contact::getById($first, $fields);
$c2 = Contact::getById($duplicate, $fields);
}
$ctarget['rel'] = $c1['rel'] | $c2['rel'];
- foreach (['prvkey', 'hub-verify', 'priority', 'rating', 'fetch_further_information', 'ffi_keyword_denylist', 'block_reason'] as $field) {
+ foreach (['prvkey', 'hub-verify', 'priority', 'rating', 'fetch_further_information', 'ffi_keyword_blacklist', 'block_reason'] as $field) {
$ctarget[$field] = $c1[$field] ?: $c2[$field];
}
"info" => ["type" => "mediumtext", "comment" => ""],
"notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
- "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
+ "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
// Deprecated, but still in use
"photo" => ["type" => "varbinary(383)", "default" => "", "comment" => "Link to the profile photo of the contact"],
"thumb" => ["type" => "varbinary(383)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
"notify_new_posts" => ["type" => "boolean", "comment" => ""],
"remote_self" => ["type" => "tinyint unsigned", "comment" => "0 => No mirroring, 1-2 => Mirror as own post, 3 => Mirror as reshare"],
"fetch_further_information" => ["type" => "tinyint unsigned", "comment" => "0 => None, 1 => Fetch information, 3 => Fetch keywords, 2 => Fetch both"],
- "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
+ "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
"subhub" => ["type" => "boolean", "comment" => ""],
"hub-verify" => ["type" => "varbinary(383)", "comment" => ""],
"protocol" => ["type" => "char(4)", "comment" => "Protocol of the contact"],
"bd" => ["contact", "bd"],
"notify_new_posts" => ["contact", "notify_new_posts"],
"fetch_further_information" => ["contact", "fetch_further_information"],
- "ffi_keyword_denylist" => ["contact", "ffi_keyword_denylist"],
+ "ffi_keyword_blacklist" => ["contact", "ffi_keyword_blacklist"],
"parent-uid" => ["user", "parent-uid"],
"guid" => ["user", "guid"],
"nickname" => ["user", "nickname"], /// @todo Replaces all uses of "nickname" with "nick"
"deleted" => ["ucontact", "deleted"],
"notify_new_posts" => ["ucontact", "notify_new_posts"],
"fetch_further_information" => ["ucontact", "fetch_further_information"],
- "ffi_keyword_denylist" => ["ucontact", "ffi_keyword_denylist"],
+ "ffi_keyword_blacklist" => ["ucontact", "ffi_keyword_blacklist"],
"rating" => ["ucontact", "rating"],
"readonly" => ["ucontact", "readonly"],
"blocked" => ["ucontact", "blocked"],
// Watchlist of indexes to watch.
'db_log_index_watch' => '',
- // db_log_index_denylist (Comma-separated list)
+ // db_log_index_blacklist (Comma-separated list)
// Deny list of indexes that shouldn't be watched.
- 'db_log_index_denylist' => '',
+ 'db_log_index_blacklist' => '',
// db_loglimit (Integer)
// If a database call lasts longer than this value in seconds it is logged.
use Friendica\Core\Worker;
use Friendica\Database\Database;
use Friendica\Database\DBA;
-use Friendica\Database\DBStructure;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
return Update::SUCCESS;
}
-
-function pre_update_1354()
-{
- if (DBStructure::existsColumn('contact', ['ffi_keyword_blacklist'])
- && !DBStructure::existsColumn('contact', ['ffi_keyword_denylist'])
- && !DBA::e("ALTER TABLE `contact` CHANGE `ffi_keyword_blacklist` `ffi_keyword_denylist` text null")) {
- return Update::FAILED;
- }
- return Update::SUCCESS;
-}
-
-function update_1354()
-{
- if (DBStructure::existsColumn('contact', ['ffi_keyword_blacklist'])
- && DBStructure::existsColumn('contact', ['ffi_keyword_denylist'])) {
- if (!DBA::e("UPDATE `contact` SET `ffi_keyword_denylist` = `ffi_keyword_blacklist`")) {
- return Update::FAILED;
- }
-
- // When the data had been copied then the main task is done.
- // Having the old field removed is only beauty but not crucial.
- // So we don't care if this was successful or not.
- DBA::e("ALTER TABLE `contact` DROP `ffi_keyword_blacklist`");
- }
- return Update::SUCCESS;
-}
-
function update_1357()
{
if (!DBA::e("UPDATE `contact` SET `failed` = true WHERE `success_update` < `failure_update` AND `failed` IS NULL")) {
{{if $fetch_further_information}}
{{include file="field_select.tpl" field=$fetch_further_information}}
- {{if $fetch_further_information.2 == 2 || $fetch_further_information.2 == 3}} {{include file="field_textarea.tpl" field=$ffi_keyword_denylist}} {{/if}}
+ {{if $fetch_further_information.2 == 2 || $fetch_further_information.2 == 3}} {{include file="field_textarea.tpl" field=$ffi_keyword_blacklist}} {{/if}}
{{/if}}
{{if $allow_remote_self}}
{{include file="field_checkbox.tpl" field=$notify_new_posts}}
{{if $fetch_further_information}}
{{include file="field_select.tpl" field=$fetch_further_information}}
- {{if $fetch_further_information.2 == 2 || $fetch_further_information.2 == 3}} {{include file="field_textarea.tpl" field=$ffi_keyword_denylist}} {{/if}}
+ {{if $fetch_further_information.2 == 2 || $fetch_further_information.2 == 3}} {{include file="field_textarea.tpl" field=$ffi_keyword_blacklist}} {{/if}}
{{/if}}
{{if $allow_remote_self}}
{{include file="field_select.tpl" field=$remote_self}}