From f376c1768107d142a6b9b0dc9beef04bf8cb6cbe Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 2 Apr 2024 15:49:20 +0100
Subject: [PATCH] Issue #3437587 by narendraR, Wim Leers: Add validation
 constraints to system.diff

(cherry picked from commit 61ac8eb21cd241e018e214bbfce150e6723033d0)
---
 core/modules/system/config/schema/system.schema.yml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/core/modules/system/config/schema/system.schema.yml b/core/modules/system/config/schema/system.schema.yml
index 309e73fe2732..679dac3cc950 100644
--- a/core/modules/system/config/schema/system.schema.yml
+++ b/core/modules/system/config/schema/system.schema.yml
@@ -121,6 +121,8 @@ system.date:
 system.diff:
   type: config_object
   label: 'Diff settings'
+  constraints:
+    FullyValidatable: ~
   mapping:
     context:
       type: mapping
@@ -129,9 +131,17 @@ system.diff:
         lines_leading:
           type: integer
           label: 'Number of leading lines in a diff'
+          constraints:
+            # @see \Drupal\Component\Diff\DiffFormatter
+            Range:
+              min: 0
         lines_trailing:
           type: integer
           label: 'Number of trailing lines in a diff'
+          constraints:
+            # @see \Drupal\Component\Diff\DiffFormatter
+            Range:
+              min: 0
 
 system.logging:
   type: config_object
-- 
GitLab