Browse Source

* 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 years ago
parent
commit
7aee2c39ab
1 changed files with 6 additions and 1 deletions
  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;
 function TCGIApplication.GetModuleName(Arequest: TRequest): string;
 
 
+var
+  S : String;
 begin
 begin
   If (FModuleVar<>'') then
   If (FModuleVar<>'') then
     Result:=ARequest.QueryFields.Values[FModuleVar];//Module name from query parameter using the FModuleVar as parameter name (default is 'Module')
     Result:=ARequest.QueryFields.Values[FModuleVar];//Module name from query parameter using the FModuleVar as parameter name (default is 'Module')
   If (Result='') then
   If (Result='') then
     begin
     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;
     Result:=ARequest.GetNextPathInfo;
     end;
     end;
 end;
 end;