Fixed text field maxlength validation newline issue [#3324]

This commit is contained in:
Matias Griese
2021-04-22 11:44:11 +03:00
parent fe1c808dfd
commit 0cf684300d
2 changed files with 4 additions and 2 deletions

View File

@@ -3,9 +3,10 @@
1. [](#improved)
* Moved `gregwar/Image` and `gregwar/Cache` in-house to official `getgrav/Image` and `getgrav/Cache` packagist packages. This will help environments with very strict proxy setups that don't allow VCS setup. [#3289](https://github.com/getgrav/grav/issues/3289)
* Improved XSS Invalid Protocol detection regex [#3298](https://github.com/getgrav/grav/issues/3298)
* Improved XSS Invalid Protocol detection regex [#3298](https://github.com/getgrav/grav/issues/3298)
1. [](#bugfix)
* Fixed `The "Grav/Common/Twig/TwigExtension" extension is not enabled` when using markdown twig tag [#3317](https://github.com/getgrav/grav/issues/3317)
* Fixed text field maxlength validation newline issue [#3324](https://github.com/getgrav/grav/issues/3324)
# v1.7.12
## 04/15/2021

View File

@@ -238,6 +238,7 @@ class Validation
$value = trim($value);
}
$value = preg_replace("/\r\n|\r/um", "\n", $value);
$len = mb_strlen($value);
$min = (int)($params['min'] ?? 0);
@@ -280,7 +281,7 @@ class Validation
$value = trim($value);
}
return $value;
return preg_replace("/\r\n|\r/um", "\n", $value);
}
/**