Because the URL of the user request under Map routing is based on the "/" rating corresponding to the controller in the directory under Controllers, the action defaults to indexaction, so you want to implement/key1/param1/key2/ Param2 This form of communication, it is necessary to delimiter the URL into Req_uri and query_str two parts.
In practice, the delimiter is defined (although it is not used), at this point, if the user's request (more crawler or sweep station) unintentionally contains the following form:/aaa/bbb[delimiter] (XXX)?/key1/param1/key2/ Param2., will cause the program to crash.
After the question was brought to the bird brother, bird brother quickly gave the repair (18~19 line):
1 if(Z_type_p (delimer) = =is_string2&&z_strlen_p (Delimer)) {3 if((Query_str =strstr(Req_uri, Z_strval_p (Delimer))) !=NULL4&& * (query_str-1) = = '/') {5TMP =Req_uri;6Rest = Query_str +z_strlen_p (delimer);7 if(*rest = = ' + ') {8Req_uri = Estrndup (Req_uri, Query_str-Req_uri);9Query_str =NULL;Ten Efree (TMP); One}Else if(*rest = = '/')) { AReq_uri = Estrndup (Req_uri, Query_str-Req_uri); -Query_str =Estrdup (rest); - Efree (TMP); the}Else { -Query_str =NULL; - } -}Else { +Query_str =NULL; -}
After Delimer obtained query_str, Judge Delimer the previous character is "/" situation, but no judgment is not the case, resulting in non-compliance with/aaa/bbb/[delimer]/key1/param1/... The form of Urk is truncated to Req_uri and query_str to parse, so there is a problem with the program.
Thanks bird Brother Quick reply!
The problem of delimiter under map routing in YAF