File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,11 @@ public static function exportRules(Rules $rules): array
114114 continue ;
115115 }
116116 } else {
117- $ item = ['op ' => ($ rule ->isNegative ? '~ ' : '' ) . $ op , 'msg ' => Validator::formatMessage ($ rule , false )];
117+ $ msg = Validator::formatMessage ($ rule , false );
118+ if ($ msg instanceof Nette \Utils \IHtmlString) {
119+ $ msg = html_entity_decode (strip_tags ((string ) $ msg ), ENT_QUOTES | ENT_HTML5 , 'UTF-8 ' );
120+ }
121+ $ item = ['op ' => ($ rule ->isNegative ? '~ ' : '' ) . $ op , 'msg ' => $ msg ];
118122 }
119123
120124 if (is_array ($ rule ->arg )) {
Original file line number Diff line number Diff line change @@ -47,7 +47,10 @@ class Validator
4747 ];
4848
4949
50- /** @internal */
50+ /**
51+ * @return string|Nette\Utils\IHtmlString
52+ * @internal
53+ */
5154 public static function formatMessage (Rule $ rule , bool $ withValue = true )
5255 {
5356 $ message = $ rule ->message ;
You can’t perform that action at this time.
0 commit comments