bmhm commented on a change in pull request #210: [SHIRO-530] INI parser does 
not properly handled backslashes at end o…
URL: https://github.com/apache/shiro/pull/210#discussion_r406377704
 
 

 ##########
 File path: config/core/src/test/groovy/org/apache/shiro/config/IniTest.groovy
 ##########
 @@ -119,24 +135,40 @@ public class IniTest {
         assertEquals("Truth", kv[0]);
         assertEquals("Beauty", kv[1]);
 
+        // Escape characters are to be removed from the key.
+        // This is different behaviour compared to the XML config.
         test = "Tru\\th=Beauty";
         kv = Ini.Section.splitKeyValue(test);
         assertEquals("Truth", kv[0]);
         assertEquals("Beauty", kv[1]);
 
-        test = "Truth\\=Beauty";
+        // SHIRO-530: Keep backslashes in value.
+        test = "Truth=Beau\\ty";
         kv = Ini.Section.splitKeyValue(test);
         assertEquals("Truth", kv[0]);
-        assertEquals("Beauty", kv[1]);
+        assertEquals("Beau\\ty", kv[1]);
 
-        test = "Truth=Beau\\ty";
+        // SHIRO-530: Keep backslashes in value.
+        test = "Truth=Beauty\\";
 
 Review comment:
   No, it should not, because we are calling the `splitKeyValue` method. The 
backslashes at the end are resolved in the caller method. When arriving at this 
point, the wrapping would have already occured. Took me a while, too, to figure 
this one out. But I did not bother to add more comments. ;-)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to