Jira Legacy | ||||||||
---|---|---|---|---|---|---|---|---|
|
Issue:
When any of the job's attributes has a quote (") in it's value it causes problems to the applications that read the accounting logs as the quotes in the values are not escaped before they get stored in the accounting logs.
...
Before writing to the accounting logs, values of the attributes should be parsed to find if the value needs to be enclosed within quotes or not.
- need_quotes = 0
- if (value has characters that are not alphanumeric)need_quotes = 1
- if (need_quotes)
make quote (") as the first character to be stored for the value.
for (each quote in the value)
else
record value without quotes.
- if (value enclosed within quotes)
if (current character is an escape)
copy next character to the value.
if (current character is an escaped quote)
copy only a quote to the value.
if (current character is a non-escaped quote)
we have reached end of the string, do not copy this quote to the value.
else
copy the value as-is.