JBehave
  1. JBehave
  2. JBEHAVE-1062

Named parameter values containing backslash and dollar characters cause side effects

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.10
    • Component/s: Core, Core Examples
    • Environment:
      Not OS dependent.
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      When using named parameters and examples table, the named parameter value can cause side effects and wrongly transmitted parameter values if the value itself contains backslash '\' and dollar '$' characters.

      This is because in ExamplesTable#replaceNamedParameters(Map<String, String>) it is used String#replaceAll(String, String).
      According to javadoc, the replaceAll uses regex capturing features, that's why using \ and $ cause side effects.

        Activity

        Show
        Szabolcs Rugina added a comment - Please see https://github.com/rszabi/jbehave-core/commit/4fbaa52b6e216d01a266e23ae624246078effd5c Thanks!
        Hide
        Mauro Talevi added a comment -

        Pulled with thanks!

        Show
        Mauro Talevi added a comment - Pulled with thanks!
        Mauro Talevi made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Mauro Talevi made changes -
        Affects Version/s 3.9.6 [ 20672 ]
        Affects Version/s 3.x [ 16979 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Szabolcs Rugina
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: