/**
* @param string $pattern
* @param string $reason
+ *
* @return int 0 if the block list couldn't be saved, 1 if the pattern was added, 2 if it was updated in place
*/
public function addPattern(string $pattern, string $reason): int
/**
* @param string $pattern
+ *
* @return int 0 if the block list couldn't be saved, 1 if the pattern wasn't found, 2 if it was removed
*/
public function removePattern(string $pattern): int
return $found ? ($this->set($blocklist) ? 2 : 0) : 1;
}
+ /**
+ * @param string $filename
+ *
+ * @return void
+ * @throws Exception
+ */
public function exportToFile(string $filename)
{
$fp = fopen($filename, 'w');
* Appends to the local block list all the patterns from the provided list that weren't already present.
*
* @param array $blocklist
+ *
* @return int The number of patterns actually added to the block list
*/
public function append(array $blocklist): int
* Extracts a server domain pattern block list from the provided CSV file name. Deduplicates the list based on patterns.
*
* @param string $filename
+ *
* @return array
* @throws Exception
*/
}
foreach ($recipients as $recipient) {
- $this->l10n->withLang($recipient['language']);
+ $l10n = $this->l10n->withLang($recipient['language']);
$email = $this->emailer->newSystemMail()
->withMessage(
- $this->l10n->t('[%s] Notice of remote server domain pattern block list update', $this->emailer->getSiteEmailName()),
- $this->l10n->t(
+ $l10n->t('[%s] Notice of remote server domain pattern block list update', $this->emailer->getSiteEmailName()),
+ $l10n->t(
'Dear %s,
You are receiving this email because the Friendica node at %s where you are registered as a user updated their remote server domain pattern block list.