-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SHIRO-812] Key value separator in config is broken with escape char #286
Conversation
Fix this 0c424d3#commitcomment-47294324 |
I have one test failed but do we want this to be possible?
|
For 2.0: no, we do not want to retain such irrational behaviour. For me, the equals sign is escaped. |
I tested out the change with an LDAP integration I have with Apache Geode. The fix works like a champ! Thanks for doing this. If I could request this to be back-ported to 1.7.x since that is what Apache Geode is on. |
I am not sure we can backport this, as this is a breaking change. See #286 (comment). @fpapon WDYT? |
IIRC, @bmarwell added some tests with the current behavior in: b50b829 public void testSplitKeyValueEscapedEquals() {
String test = "Truth\\=Beauty";
String[] kv = Ini.Section.splitKeyValue(test);
assertEquals("Truth", kv[0]);
assertEquals("Beauty", kv[1]);
} The above was existing behavior. Though the more I look at it this must have been a side effect/bug. I cannot imagine why you would want this behavior, I would have expected I'm guessing this might have been the result of the key and value logic sharing the same escape logic. TL;DR, I think this is a bug, and we should fix it in any version. (We do need to make this clear in the release notes, anyone caught by this should be able to process the INI file/string to strip out the odd Thoughts? |
+1. Cherry pick into 1.7.x, remove the test. This behaviour can be restored easily by removing one backslash and does not look intentional. |
Ok I will cherrypick to 1.7.x branch and add info in the release note. |
This is a cleaner way and should fix up the "escaped escape-char" case (i.e. handle "//" as a single "/")
|
@todmorrison thanks for your feedback, I will take a look. |
@todmorrison I'm not sure to understand your code because our test failed. Did you take a look on our utests? |
Hi @fpapon, You're right. I partially amend my comment. The first part, changing:
to
is correct. The middle case is redundant since For the second part, Anyway, I do feel my observation that the middle case in the first conditional is redundant is worth fixing. I withdraw the second change though. |
No description provided.