OSDN Git Service

・スレタイの特定ワードを非表示にする機能に「©bbspink.com」も追加
[gikonavigoeson/gikonavi.git] / Trip.pas
index bf31577..262268f 100644 (file)
--- a/Trip.pas
+++ b/Trip.pas
@@ -424,12 +424,12 @@ procedure get_pw_salt(
     const pw : PChar;
     var convpw : String;
     const salt : PChar
-);
+) ;
 var
     i : integer;
 begin
     // ^([0-9A-Fa-f]{16})([./0-9A-Za-z]{0,2})$
-    if (Length(pw) >= 17) or (Length(pw) <= 19) then begin
+    if (Length(pw) >= 17) and (Length(pw) <= 19) then begin
         // \83L\81[\95\94\95ª
         for  i := 0 to 7 do begin
             if (Pos(pw[2*i + 0 + 1], '0123456789abcdefABCDEF') > 0) and
@@ -494,15 +494,18 @@ begin
             Result := '???';
         end else begin
             convpw := '';
-            // \90\83L\81[\95û\8e®
-            if pw[ 0 ] = '#' then begin
-                get_pw_salt(pw, convpw, salt);
-            end;
-            if (pw[ 0 ] = '#') and (Length(pw) >= 12) then begin
+            if (pw[ 0 ] = '#') and (Length(pw) >= 20) then begin
                 // \8f«\97\88\82Ì\8ag\92£\97p
                 Result := '???';
-            end else if Length(convpw) = 8 then begin
-                Result := Copy( crypt_r( PChar(convpw), salt, s ), 4, 100 );
+            end else if pw[ 0 ] = '#' then begin
+                // \90\83L\81[\95û\8e®
+                get_pw_salt(pw, convpw, salt);
+                if Length(convpw) = 0 then begin
+                    // \90\83L\81[\95û\8e®\83G\83\89\81[
+                    Result := '???';
+                end else if Length(convpw) = 8 then begin
+                    Result := Copy( crypt_r( PChar(convpw), salt, s ), 4, 100 );
+                end
             end else begin
                 // \90V\95û\8e®
                 StringHashSHA1(digest, pw);