From 4fb8a4c6a8bda9cbac06da2e456a6412bde9e313 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 1 Sep 2020 01:19:58 +0200 Subject: [PATCH] Revert "Rename contact table column to ffi_keyword_denylist" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This reverts commit 34463f37e4a3226709853bd3e35e6c22da45502c. Signed-off-by: Roland Häder --- database.sql | 8 +++--- doc/database/db_contact.md | 4 +-- doc/database/db_user-contact.md | 2 +- .../Entity/LocalRelationship.php | 8 +++--- .../Factory/LocalRelationship.php | 2 +- .../Repository/LocalRelationship.php | 2 +- src/Content/PageInfo.php | 20 ++++++------- src/Content/Text/BBCode.php | 2 +- src/Database/Database.php | 16 +++++------ src/Module/Contact/Profile.php | 6 ++-- src/Protocol/Feed.php | 9 +++--- src/Worker/MergeContact.php | 4 +-- static/dbstructure.config.php | 4 +-- static/dbview.config.php | 4 +-- static/defaults.config.php | 4 +-- update.php | 28 ------------------- view/templates/contact_edit.tpl | 2 +- view/theme/frio/templates/contact_edit.tpl | 2 +- 18 files changed, 50 insertions(+), 77 deletions(-) diff --git a/database.sql b/database.sql index 9c98c614a9..53166dc6eb 100644 --- a/database.sql +++ b/database.sql @@ -190,7 +190,7 @@ CREATE TABLE IF NOT EXISTS `contact` ( `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)', @@ -1929,7 +1929,7 @@ CREATE TABLE IF NOT EXISTS `user-contact` ( `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', @@ -2944,7 +2944,7 @@ CREATE VIEW `owner-view` AS SELECT `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`, @@ -3152,7 +3152,7 @@ CREATE VIEW `account-user-view` AS SELECT `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`, diff --git a/doc/database/db_contact.md b/doc/database/db_contact.md index 8221f279e2..66fc7e97ba 100644 --- a/doc/database/db_contact.md +++ b/doc/database/db_contact.md @@ -70,7 +70,7 @@ Fields | 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 | | | | @@ -96,7 +96,7 @@ Fields | profile-id | Deprecated | int unsigned | YES | | NULL | | Indexes ------------- +------- | Name | Fields | | --------------------------- | ------------------------------------ | diff --git a/doc/database/db_user-contact.md b/doc/database/db_user-contact.md index bfba9cb651..e6cdaa5faf 100644 --- a/doc/database/db_user-contact.md +++ b/doc/database/db_user-contact.md @@ -23,7 +23,7 @@ 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 | | diff --git a/src/Contact/LocalRelationship/Entity/LocalRelationship.php b/src/Contact/LocalRelationship/Entity/LocalRelationship.php index 66281fbaeb..670cae84aa 100644 --- a/src/Contact/LocalRelationship/Entity/LocalRelationship.php +++ b/src/Contact/LocalRelationship/Entity/LocalRelationship.php @@ -38,7 +38,7 @@ use Friendica\Model\Contact; * @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 @@ -82,7 +82,7 @@ class LocalRelationship extends \Friendica\BaseEntity /** @var int One of FFI_* */ protected $fetchFurtherInformation; /** @var string */ - protected $ffiKeywordDenylist; + protected $ffiKeywordblacklist; /** @var bool */ protected $subhub; /** @var string */ @@ -94,7 +94,7 @@ class LocalRelationship extends \Friendica\BaseEntity /** @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; @@ -108,7 +108,7 @@ class LocalRelationship extends \Friendica\BaseEntity $this->notifyNewPosts = $notifyNewPosts; $this->remoteSelf = $remoteSelf; $this->fetchFurtherInformation = $fetchFurtherInformation; - $this->ffiKeywordDenylist = $ffiKeywordDenylist; + $this->ffiKeywordblacklist = $ffiKeywordblacklist; $this->subhub = $subhub; $this->hubVerify = $hubVerify; $this->protocol = $protocol; diff --git a/src/Contact/LocalRelationship/Factory/LocalRelationship.php b/src/Contact/LocalRelationship/Factory/LocalRelationship.php index e923dfd39a..dddbbbdf96 100644 --- a/src/Contact/LocalRelationship/Factory/LocalRelationship.php +++ b/src/Contact/LocalRelationship/Factory/LocalRelationship.php @@ -47,7 +47,7 @@ class LocalRelationship extends BaseFactory implements ICanCreateFromTableRow $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, diff --git a/src/Contact/LocalRelationship/Repository/LocalRelationship.php b/src/Contact/LocalRelationship/Repository/LocalRelationship.php index 4f71888e0d..12d2cc5e65 100644 --- a/src/Contact/LocalRelationship/Repository/LocalRelationship.php +++ b/src/Contact/LocalRelationship/Repository/LocalRelationship.php @@ -102,7 +102,7 @@ class LocalRelationship extends \Friendica\BaseRepository '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, diff --git a/src/Content/PageInfo.php b/src/Content/PageInfo.php index b80a551cb9..a92849eba2 100644 --- a/src/Content/PageInfo.php +++ b/src/Content/PageInfo.php @@ -86,13 +86,13 @@ class PageInfo * @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); } @@ -181,11 +181,11 @@ class PageInfo * @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); @@ -195,8 +195,8 @@ class PageInfo 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); @@ -216,13 +216,13 @@ class PageInfo /** * @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 []; diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index efaa9f7c79..835a96e4d3 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1958,7 +1958,7 @@ class BBCode $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', []); diff --git a/src/Database/Database.php b/src/Database/Database.php index c296683d2b..a1685d4272 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -325,22 +325,22 @@ class Database } // 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)) { @@ -354,7 +354,7 @@ class Database $log = true; } - if (in_array($row['key'], $denylist) || ($row['key'] == "")) { + if (in_array($row['key'], $blacklist) || ($row['key'] == '')) { $log = false; } @@ -364,8 +364,8 @@ class Database $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 ); @@ -374,7 +374,7 @@ class Database } /** - * 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 diff --git a/src/Module/Contact/Profile.php b/src/Module/Contact/Profile.php index 38260e9da7..faa1c8a640 100644 --- a/src/Module/Contact/Profile.php +++ b/src/Module/Contact/Profile.php @@ -115,8 +115,8 @@ class Profile extends BaseModule $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'])) { @@ -394,7 +394,7 @@ class Profile extends BaseModule '$hidden' => ['hidden', $this->t('Hide this contact from others'), $localRelationship->hidden, $this->t('Replies/likes to your public posts may 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, diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index c67894494c..b425f1cd27 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -617,8 +617,9 @@ class Feed $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)) { @@ -638,7 +639,7 @@ class Feed // 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 = []; @@ -672,7 +673,7 @@ class Feed 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 { diff --git a/src/Worker/MergeContact.php b/src/Worker/MergeContact.php index 375ecdd7fa..2a8dadf1b0 100644 --- a/src/Worker/MergeContact.php +++ b/src/Worker/MergeContact.php @@ -86,7 +86,7 @@ class MergeContact 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); @@ -97,7 +97,7 @@ class MergeContact } $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]; } diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index f1c4d4bda6..aa5c3f982f 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -248,7 +248,7 @@ return [ "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)"], @@ -1920,7 +1920,7 @@ return [ "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"], diff --git a/static/dbview.config.php b/static/dbview.config.php index f0183db81a..a7a1eed364 100644 --- a/static/dbview.config.php +++ b/static/dbview.config.php @@ -980,7 +980,7 @@ "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" @@ -1184,7 +1184,7 @@ "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"], diff --git a/static/defaults.config.php b/static/defaults.config.php index 819b0ad85f..7ce24b9c27 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -181,9 +181,9 @@ return [ // 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. diff --git a/update.php b/update.php index 0e655e83db..65f8bd2d75 100644 --- a/update.php +++ b/update.php @@ -49,7 +49,6 @@ use Friendica\Core\Update; 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; @@ -316,33 +315,6 @@ function update_1351() 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")) { diff --git a/view/templates/contact_edit.tpl b/view/templates/contact_edit.tpl index 38414fabe9..33d1cfd39f 100644 --- a/view/templates/contact_edit.tpl +++ b/view/templates/contact_edit.tpl @@ -73,7 +73,7 @@ {{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}} diff --git a/view/theme/frio/templates/contact_edit.tpl b/view/theme/frio/templates/contact_edit.tpl index 237c4f4345..a7fc89b6a7 100644 --- a/view/theme/frio/templates/contact_edit.tpl +++ b/view/theme/frio/templates/contact_edit.tpl @@ -145,7 +145,7 @@ {{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}} -- 2.39.5