Revision: 29922
          http://sourceforge.net/p/bibdesk/svn/29922
Author:   hofman
Date:     2025-12-01 10:11:28 +0000 (Mon, 01 Dec 2025)
Log Message:
-----------
check for escaped characters before escaping

Modified Paths:
--------------
    trunk/bibdesk/NSString_BDSKExtensions.m

Modified: trunk/bibdesk/NSString_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSString_BDSKExtensions.m     2025-11-30 18:49:58 UTC (rev 
29921)
+++ trunk/bibdesk/NSString_BDSKExtensions.m     2025-12-01 10:11:28 UTC (rev 
29922)
@@ -865,6 +865,11 @@
 }
 
 - (NSString *)stringByEscapingGroupPlistEntities{
+    static NSCharacterSet *escapedCharsSet = nil;
+    if (escapedCharsSet == nil)
+        escapedCharsSet = [NSCharacterSet 
characterSetWithCharactersInString:@"%{}<>@"];
+    if ([self rangeOfCharacterFromSet:escapedCharsSet].location == NSNotFound)
+        return self;
        NSMutableString *escapedValue = [self mutableCopy];
        // escape braces as they can give problems with btparse
        [escapedValue replaceOccurrencesOfString:@"%" withString:@"%25" 
options:0 range:NSMakeRange(0, [escapedValue length])]; // this should come 
first
@@ -877,6 +882,8 @@
 }
 
 - (NSString *)stringByUnescapingGroupPlistEntities{
+    if ([self containsString:@"%"] == NO)
+        return self;
        NSMutableString *escapedValue = [self mutableCopy];
        // escape braces as they can give problems with btparse, and angles as 
they can give problems with the plist xml
        [escapedValue replaceOccurrencesOfString:@"%7B" withString:@"{" 
options:0 range:NSMakeRange(0, [escapedValue length])];

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



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to