File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -170,17 +170,17 @@ protected function parseCommand()
170
170
if ($ optionValue ) {
171
171
$ optionValue = false ;
172
172
} else {
173
- $ this ->segments [] = esc ( strip_tags ( $ arg)) ;
173
+ $ this ->segments [] = $ arg ;
174
174
}
175
175
176
176
continue ;
177
177
}
178
178
179
- $ arg = esc ( strip_tags ( ltrim ($ arg , '- ' )) );
179
+ $ arg = ltrim ($ arg , '- ' );
180
180
$ value = null ;
181
181
182
182
if (isset ($ args [$ i + 1 ]) && mb_strpos ($ args [$ i + 1 ], '- ' ) !== 0 ) {
183
- $ value = esc ( strip_tags ( $ args [$ i + 1 ])) ;
183
+ $ value = $ args [$ i + 1 ];
184
184
$ optionValue = true ;
185
185
}
186
186
Original file line number Diff line number Diff line change @@ -61,6 +61,30 @@ public function testParsingSegments()
61
61
$ this ->assertSame ($ segments , $ this ->request ->getSegments ());
62
62
}
63
63
64
+ public function testParsingSegmentsWithHTMLMetaChars ()
65
+ {
66
+ $ _SERVER ['argv ' ] = [
67
+ 'index.php ' ,
68
+ 'users ' ,
69
+ '21 ' ,
70
+ 'abc < def ' ,
71
+ "McDonald's " ,
72
+ '<s>aaa</s> ' ,
73
+ ];
74
+
75
+ // reinstantiate it to force parsing
76
+ $ this ->request = new CLIRequest (new App ());
77
+
78
+ $ segments = [
79
+ 'users ' ,
80
+ '21 ' ,
81
+ 'abc < def ' ,
82
+ "McDonald's " ,
83
+ '<s>aaa</s> ' ,
84
+ ];
85
+ $ this ->assertSame ($ segments , $ this ->request ->getSegments ());
86
+ }
87
+
64
88
public function testParsingOptions ()
65
89
{
66
90
$ _SERVER ['argv ' ] = [
You can’t perform that action at this time.
0 commit comments