소스 검색

* Partly reverted r11927, in which perfectly valid code was replaced with a one-line obfuscation which can cause an AV

git-svn-id: trunk@11987 -
joost 17 년 전
부모
커밋
7aee2c39ab
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      packages/fcl-web/src/fpcgi.pp

+ 6 - 1
packages/fcl-web/src/fpcgi.pp

@@ -75,12 +75,17 @@ end;
 
 function TCGIApplication.GetModuleName(Arequest: TRequest): string;
 
+var
+  S : String;
 begin
   If (FModuleVar<>'') then
     Result:=ARequest.QueryFields.Values[FModuleVar];//Module name from query parameter using the FModuleVar as parameter name (default is 'Module')
   If (Result='') then
     begin
-    if (Pos('/', pchar(@ARequest.PathInfo[2])) <= 0) and AllowDefaultModule then Exit;//There is only 1 '/' in ARequest.PathInfo -> only ActionName is there -> use default module
+    S:=ARequest.PathInfo;
+    Delete(S,1,1);
+    if (Pos('/',S) <= 0) and AllowDefaultModule then
+      Exit;//There is only 1 '/' in ARequest.PathInfo -> only ActionName is there -> use default module
     Result:=ARequest.GetNextPathInfo;
     end;
 end;