OSDN Git Service

・色々と URL に関する不具合を修正。
authoryoffy <yoffy>
Sun, 23 Nov 2003 10:38:30 +0000 (10:38 +0000)
committeryoffy <yoffy>
Sun, 23 Nov 2003 10:38:30 +0000 (10:38 +0000)
Giko.pas
GikoSystem.pas

index 0c7ccb5..11cf000 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -6081,7 +6081,7 @@ begin
        GikoSys.ParseURI( URL, protocol, host, path, document, port, bookmark );
        GikoSys.Parse2chURL( URL, path, document, BBSID, BBSKey );
 
-       if GikoSys.Is2chHost(Host) then begin
+       if (Length( Trim(BBSKey) ) > 0) and (Length( Trim(BBSID) ) > 0) then begin
                Board := BBSsFindBoardFromURL( GikoSys.Get2chThreadURL2BoardURL( URL ) );
                if Board = nil then begin
                        GikoSys.OpenBrowser(URL, gbtAuto);
index 2f12984..88abe07 100644 (file)
@@ -520,9 +520,6 @@ begin
 
        sl := TStringList.Create;
        try
-               if Pos( 'giko', board.URL ) > 0 then begin
-                       messagebox( 0, '', '', MB_OK );
-               end;
                if FileExists(FileName) then
                        sl.LoadFromFile(FileName);
 
@@ -2675,29 +2672,32 @@ begin
        ParseURI( inURL, Protocol, Host, Path, Document, Port, Bookmark );
        Parse2chURL( inURL, Path, Document, BBSID, BBSKey );
 
-       Result := Protocol + '://' + Host + '/' + BBSID + '/';
+       Result := Copy( inURL, 1, Pos( '/test/read.cgi', inURL ) ) + BBSID + '/';
 
 end;
 
 function       TGikoSys.Get2chBrowsableThreadURL(
-       inURL : string
+       inURL                   : string
 ) : string;
 var
        Protocol, Host, Path, Document, Port, Bookmark : string;
        BBSID, BBSKey : string;
+       foundPos        : Integer;
 begin
 
        if Pos( KAKO_PATH, inURL ) > 0 then begin
                Result := inURL;
        end else begin
                ParseURI( inURL, Protocol, Host, Path, Document, Port, Bookmark );
+               Parse2chURL( inURL, Path, Document, BBSID, BBSKey );
+               foundPos := Pos( '/test/read.cgi', inURL );
 
                if Is2chHost( Host ) then begin
-                       Parse2chURL( inURL, Path, Document, BBSID, BBSKey );
-                       Result := Protocol + '://' + Host + Path + READ_PATH + BBSID + '/' + BBSKey + '/l50';
+                       Result := Copy( inURL, 1, foundPos ) +
+                               READ_PATH + BBSID + '/' + BBSKey + '/l50';
                end else begin
-                       Parse2chURL( inURL, Path, Document, BBSID, BBSKey );
-                       Result := Protocol + '://' + Host + Path + OLD_READ_PATH + 'bbs=' + BBSID + '&key=' + BBSKey + '&ls=50';
+                       Result := Copy( inURL, 1, foundPos ) +
+                               OLD_READ_PATH + 'bbs=' + BBSID + '&key=' + BBSKey + '&ls=50';
                end;
        end;
 
@@ -2708,7 +2708,6 @@ function  TGikoSys.Get2chBoard2ThreadURL(
        inKey           : string
 ) : string;
 var
-       url                     : string;
        server  : string;
 begin