File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
system/ThirdParty/Escaper Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 44
55namespace Laminas \Escaper ;
66
7+ use function assert ;
78use function bin2hex ;
89use function ctype_digit ;
910use function hexdec ;
1011use function htmlspecialchars ;
1112use function in_array ;
13+ use function is_string ;
1214use function mb_convert_encoding ;
1315use function ord ;
1416use function preg_match ;
@@ -207,6 +209,8 @@ public function escapeHtmlAttr(string $string)
207209 }
208210
209211 $ result = preg_replace_callback ('/[^a-z0-9,\.\-_]/iSu ' , $ this ->htmlAttrMatcher , $ string );
212+ assert (is_string ($ result ));
213+
210214 return $ this ->fromUtf8 ($ result );
211215 }
212216
@@ -229,6 +233,8 @@ public function escapeJs(string $string)
229233 }
230234
231235 $ result = preg_replace_callback ('/[^a-z0-9,\._]/iSu ' , $ this ->jsMatcher , $ string );
236+ assert (is_string ($ result ));
237+
232238 return $ this ->fromUtf8 ($ result );
233239 }
234240
@@ -258,6 +264,8 @@ public function escapeCss(string $string)
258264 }
259265
260266 $ result = preg_replace_callback ('/[^a-z0-9]/iSu ' , $ this ->cssMatcher , $ string );
267+ assert (is_string ($ result ));
268+
261269 return $ this ->fromUtf8 ($ result );
262270 }
263271
You can’t perform that action at this time.
0 commit comments