File tree Expand file tree Collapse file tree 1 file changed +2
-25
lines changed Expand file tree Collapse file tree 1 file changed +2
-25
lines changed Original file line number Diff line number Diff line change @@ -114,33 +114,10 @@ public function getMethod(){
114114 return $ this ->method ;
115115 }
116116
117- // https://github.com/guzzle/psr7/blob/master/src/functions.php
117+ // this was no longer working --- https://github.com/guzzle/psr7/blob/master/src/functions.php
118118 public static function parseQuery ($ query ){
119-
120119 $ result = array ();
121-
122- foreach (explode ('& ' , $ query ) as $ kvp ){
123- $ parts = explode ('= ' , $ kvp );
124- $ key = rawurldecode ($ parts [0 ]);
125- if (substr ($ key , -2 ) == '[] ' ){
126- $ key = substr ($ key , 0 , -2 );
127- }
128-
129- // keys with NULL will be ignored in http_build_query - that's why it has to be ''
130- $ value = isset ($ parts [1 ]) ? rawurldecode ($ parts [1 ]) : '' ;
131-
132- // brand new key=value
133- if (!isset ($ result [$ key ])){
134- $ result [$ key ] = $ value ;
135- } else {
136- // key already exists in some form...
137- if (!is_array ($ result [$ key ])){
138- $ result [$ key ] = array ($ result [$ key ]);
139- }
140-
141- $ result [$ key ][] = $ value ;
142- }
143- }
120+ parse_str ($ query , $ result );
144121
145122 return $ result ;
146123 }
You can’t perform that action at this time.
0 commit comments