Skip to content
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

String-Escape Bug in RtfBuilder.cs => CheckChar #6

Open
ststeiger opened this issue Mar 14, 2019 · 0 comments
Open

String-Escape Bug in RtfBuilder.cs => CheckChar #6

ststeiger opened this issue Mar 14, 2019 · 0 comments

Comments

@ststeiger
Copy link

ststeiger commented Mar 14, 2019

On line 89 of RtfBuilder.cs, you do the following:

value = value.Replace("{", "\\{").Replace("}", "\\}").Replace("\\", "\\\\");

This is wrong.
First, you escape { with \{, then you escape \ with \\, effectively escaping { with \\{ ...

This effectively transforms
update [#tSVE] set [SVE_Content].modify('insert attribute data-uid {sql:column("OBJ_UID")} into (/svg/*)[1]') where([SVE_Content].exist('/svg/node()[@data-uid]') = 0) and not [OBJ_UID] is null;
into
update [#tSVE] set [SVE_Content].modify('insert attribute data-uid \sql:column("OBJ_UID")\ into (/svg/*)[1]') where([SVE_Content].exist('/svg/node()[@data-uid]') = 0) and not [OBJ_UID] is null;

note the \sql:column instead of {sql:column

You need to first escape \ with \, then espace { and }.
ststeiger/ExpressProfiler@1b1b0da

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant