fix: Schriftname wird vor der Katalogprüfung getrimmt (Theme-Optionen)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
2b45f1bdd3
commit
0a24753b4d
@@ -170,17 +170,17 @@ final class DiviThemeOptionsUpdateAbility implements Ability, RequiresDiviFeatur
|
||||
return null;
|
||||
}
|
||||
$problem = ThemeOptionSpec::check($key, $value);
|
||||
$normalized = $problem === null ? ThemeOptionSpec::normalize($key, $value) : null;
|
||||
if ($problem === null && ThemeOptionSpec::definition($key)['type'] === 'font') {
|
||||
// Before Divi's sanitizer: it would only answer false, without suggestions.
|
||||
$problem = FontCheck::problem($this->fonts, (string) $value);
|
||||
// Before Divi's sanitizer: it would only answer false, without suggestions. The trimmed name is checked.
|
||||
$problem = FontCheck::problem($this->fonts, (string) $normalized);
|
||||
}
|
||||
if ($problem !== null) {
|
||||
$errors[$field] = $problem;
|
||||
if ($problem !== null || $normalized === null) {
|
||||
$errors[$field] = $problem ?? 'Divi lehnt den Wert ab';
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
$normalized = ThemeOptionSpec::normalize($key, $value);
|
||||
$sanitized = $this->options->sanitize($key, $normalized);
|
||||
if (! is_int($sanitized) && ! is_float($sanitized) && ! is_string($sanitized)) {
|
||||
$errors[$field] = 'Divi lehnt den Wert ab';
|
||||
|
||||
Reference in New Issue
Block a user