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 4
4
5
5
namespace Laminas \Escaper ;
6
6
7
+ use function assert ;
7
8
use function bin2hex ;
8
9
use function ctype_digit ;
9
10
use function hexdec ;
10
11
use function htmlspecialchars ;
11
12
use function in_array ;
13
+ use function is_string ;
12
14
use function mb_convert_encoding ;
13
15
use function ord ;
14
16
use function preg_match ;
@@ -207,6 +209,8 @@ public function escapeHtmlAttr(string $string)
207
209
}
208
210
209
211
$ result = preg_replace_callback ('/[^a-z0-9,\.\-_]/iSu ' , $ this ->htmlAttrMatcher , $ string );
212
+ assert (is_string ($ result ));
213
+
210
214
return $ this ->fromUtf8 ($ result );
211
215
}
212
216
@@ -229,6 +233,8 @@ public function escapeJs(string $string)
229
233
}
230
234
231
235
$ result = preg_replace_callback ('/[^a-z0-9,\._]/iSu ' , $ this ->jsMatcher , $ string );
236
+ assert (is_string ($ result ));
237
+
232
238
return $ this ->fromUtf8 ($ result );
233
239
}
234
240
@@ -258,6 +264,8 @@ public function escapeCss(string $string)
258
264
}
259
265
260
266
$ result = preg_replace_callback ('/[^a-z0-9]/iSu ' , $ this ->cssMatcher , $ string );
267
+ assert (is_string ($ result ));
268
+
261
269
return $ this ->fromUtf8 ($ result );
262
270
}
263
271
You can’t perform that action at this time.
0 commit comments