[ 
https://issues.apache.org/jira/browse/NIFI-1915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15299999#comment-15299999
 ] 

Oleg Zhurakousky commented on NIFI-1915:
----------------------------------------

Stephane
Wasn't thinking clearly last night. The _$_ is a special character and while we 
try our best to determine intention of the user, when you send '$number' 
(backreference) we can't assume you want it to be treated literally as someone 
else would have an opposite expectation. 
Since it comes as an attribute in your code, I'd suggest to introduce 
UpdateAttribute upstream and update the attribute string 'a$2' with escape 
characters before sending it to ReplaceText.

Anyway, i'll resubmit PR as of yesterday with no additional changes.
Yet, let us know your thoughts.

> ReplaceText infinite loops when attribute contains $ sign
> ---------------------------------------------------------
>
>                 Key: NIFI-1915
>                 URL: https://issues.apache.org/jira/browse/NIFI-1915
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 0.6.1
>            Reporter: Stephane Maarek
>            Assignee: Oleg Zhurakousky
>            Priority: Critical
>             Fix For: 1.0.0, 0.7.0
>
>
> I think the biggest issue is that the text inside of an attribute isn't 
> properly escaped when written to a String, which brings conflict when the 
> text contains dollar signs ($)
> That's a big roadblock for me as I can't predict if and when some $ signs may 
> be present in the data
> An easy way to reproduce is to take the csv to json template here:
> https://cwiki.apache.org/confluence/download/attachments/57904847/CsvToJSON.xml?version=1&modificationDate=1442927496000&api=v2
>  
> In the first ReplaceText, replace a,b,c,d by a$a,b,c,d (it simulates data 
> that may or may not contain a $ sign)
> Launch the flow, you'll see the errors / warning / infinite loop



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to