Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F6913540
raw.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
vanmeeuwen
Apr 7 2021, 2:16 PM
2021-04-07 14:16:17 (UTC+2)
Size
1 KB
Referenced Files
None
Subscribers
None
raw.txt
View Options
public function setConfig(array $config): array
{
$errors = [];
foreach ($config as $key => $value) {
// validate and save SPF whitelist entries
if ($key === 'spf_whitelist') {
if (!is_array($value)) {
$value = (array) $value;
}
foreach ($value as $i => $v) {
$v = rtrim($v, '.');
if (empty($v)) {
unset($value[$i]);
continue;
}
$value[$i] = $v;
if ($v[0] !== '.' || !filter_var(substr($v, 1), FILTER_VALIDATE_DOMAIN)) {
$errors[$key][$i] = \trans('validation.spf-entry-invalid');
}
}
if (empty($errors[$key])) {
$this->setSetting($key, json_encode($value));
}
} else {
$errors[$key] = \trans('validation.invalid-config-parameter');
}
}
return $errors;
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4242571
Default Alt Text
raw.txt (1 KB)
Attached To
Mode
P64 (An Untitled Masterwork)
Attached
Detach File
Event Timeline
Log In to Comment