You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by GitBox <gi...@apache.org> on 2021/04/14 21:02:11 UTC

[GitHub] [shiro] todmorrison commented on pull request #286: [SHIRO-812] Key value separator in config is broken with escape char

todmorrison commented on pull request #286:
URL: https://github.com/apache/shiro/pull/286#issuecomment-819829577


   This is a cleaner way and should fix up the "escaped escape-char" case (i.e. handle "//" as a single "/")
   
   `                if (buildingKey) {
                     // Given that isCharEscaped actually means isEscapeChar, the middle case is always
                     // false.
                     // if (isKeyValueSeparatorChar(c) && !isCharEscaped(line, i) && !isCharEscaped(line, i-1)) {
                       if (isKeyValueSeparatorChar(c) &&  !isCharEscaped(line, i-1)) {
                           buildingKey = false;//now start building the value
                     // Allow escaped escape character -- adjusting for the misleading naming of isCharEscaped
                       } else if (!isCharEscaped(line, i) || !isCharEscaped(line, i-1) ){
                           keyBuffer.append(c);
                       }
   `


-- 
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:
users@infra.apache.org