Revision: 29238
          http://sourceforge.net/p/bibdesk/svn/29238
Author:   hofman
Date:     2025-04-29 13:36:58 +0000 (Tue, 29 Apr 2025)
Log Message:
-----------
Add secure as query key, also can be https. Set secure option when setting 
https URL in address, percent escape database fom address.

Modified Paths:
--------------
    trunk/bibdesk/BDSKSearchGroup.m
    trunk/bibdesk/BDSKServerInfo.m

Modified: trunk/bibdesk/BDSKSearchGroup.m
===================================================================
--- trunk/bibdesk/BDSKSearchGroup.m     2025-04-29 09:38:46 UTC (rev 29237)
+++ trunk/bibdesk/BDSKSearchGroup.m     2025-04-29 13:36:58 UTC (rev 29238)
@@ -75,9 +75,9 @@
 
 + (void)initialize {
     BDSKINITIALIZE;
-    BDSKSearchGroupURLQueryKeys = [[NSMapTable alloc] 
initWithKeyPointerFunctions:[NSPointerFunctions 
caseInsensitiveStringPointerFunctions] 
valuePointerFunctions:[NSPointerFunctions strongObjectPointerFunctions] 
capacity:16];
-    NSString *keys[16] = {@"searchTerm", @"term", @"name", @"database", @"db", 
@"password", @"username", @"user", @"recordSyntax", @"syntax", 
@"resultEncoding", @"encoding", @"removeDiacritics", @"lite", @"type", 
@"version"};
-    NSString *objects[16] = {@"searchTerm", @"searchTerm", @"name", 
@"database", @"database", @"password", @"username", @"username", 
@"recordSyntax", @"recordSyntax", @"resultEncoding", @"resultEncoding", 
@"removeDiacritics", @"lite", @"type", @"version"};
+    BDSKSearchGroupURLQueryKeys = [[NSMapTable alloc] 
initWithKeyPointerFunctions:[NSPointerFunctions 
caseInsensitiveStringPointerFunctions] 
valuePointerFunctions:[NSPointerFunctions strongObjectPointerFunctions] 
capacity:18];
+    NSString *keys[18] = {@"searchTerm", @"term", @"name", @"database", @"db", 
@"password", @"username", @"user", @"recordSyntax", @"syntax", 
@"resultEncoding", @"encoding", @"removeDiacritics", @"secure", @"https", 
@"lite", @"type", @"version"};
+    NSString *objects[18] = {@"searchTerm", @"searchTerm", @"name", 
@"database", @"database", @"password", @"username", @"username", 
@"recordSyntax", @"recordSyntax", @"resultEncoding", @"resultEncoding", 
@"removeDiacritics", @"secure", @"secure", @"lite", @"type", @"version"};
     NSUInteger i;
     for (i = 0; i < 16; i++)
         [BDSKSearchGroupURLQueryKeys setObject:objects[i] forKey:keys[i]];

Modified: trunk/bibdesk/BDSKServerInfo.m
===================================================================
--- trunk/bibdesk/BDSKServerInfo.m      2025-04-29 09:38:46 UTC (rev 29237)
+++ trunk/bibdesk/BDSKServerInfo.m      2025-04-29 13:36:58 UTC (rev 29238)
@@ -532,12 +532,17 @@
         NSRange range = [string rangeOfString:@"://"];
         if(range.location != NSNotFound){
             // ZOOM gets confused when the host has a protocol
+            if ([self isSRU] && [[string substringToIndex:range.location] 
isCaseInsensitiveEqual:@"https"])
+                [self setSecure:YES];
             string = [string substringFromIndex:NSMaxRange(range)];
         }
+        range = [string rangeOfString:@"?"];
+        if (range.location != NSNotFound)
+            string = [string substringToIndex:range.location];
         // split address:port/dbase in components
         range = [string rangeOfString:@"/"];
         if(range.location != NSNotFound){
-            [self setDatabase:[string substringFromIndex:NSMaxRange(range)]];
+            [self setDatabase:[[string substringFromIndex:NSMaxRange(range)] 
stringByRemovingPercentEncoding]];
             string = [string substringToIndex:range.location];
         }
         range = [string rangeOfString:@":"];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to