File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,17 +170,17 @@ protected function parseCommand()
170170 if ($ optionValue ) {
171171 $ optionValue = false ;
172172 } else {
173- $ this ->segments [] = esc ( strip_tags ( $ arg)) ;
173+ $ this ->segments [] = $ arg ;
174174 }
175175
176176 continue ;
177177 }
178178
179- $ arg = esc ( strip_tags ( ltrim ($ arg , '- ' )) );
179+ $ arg = ltrim ($ arg , '- ' );
180180 $ value = null ;
181181
182182 if (isset ($ args [$ i + 1 ]) && mb_strpos ($ args [$ i + 1 ], '- ' ) !== 0 ) {
183- $ value = esc ( strip_tags ( $ args [$ i + 1 ])) ;
183+ $ value = $ args [$ i + 1 ];
184184 $ optionValue = true ;
185185 }
186186
Original file line number Diff line number Diff line change @@ -61,6 +61,30 @@ public function testParsingSegments()
6161 $ this ->assertSame ($ segments , $ this ->request ->getSegments ());
6262 }
6363
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+
6488 public function testParsingOptions ()
6589 {
6690 $ _SERVER ['argv ' ] = [
You can’t perform that action at this time.
0 commit comments