Forum Discussion
martin_58353
Sep 11, 2017Cirrus
STREAM::expression with special characters
I need inject code into JavaScript returned from server some code:
original code from server:
this.initNewTransfer(t, n),
replaced/injected code:
this.i...
- Sep 11, 2017
I found correct strings for replacement:
set find "initNewTransfer\\x28t, n\\)" set replace "this.initNewTransfer\x28t, n\), INJECTED-CODE"
Is there any better solution?
martin_58353
Cirrus
I found correct strings for replacement:
set find "initNewTransfer\\x28t, n\\)"
set replace "this.initNewTransfer\x28t, n\), INJECTED-CODE"
Is there any better solution?
cjunior
Sep 11, 2017Nacreous
I honestly don't know why the first parenthesis causes disruption for the logic. This way, sometimes I workaround using hexa chars like you did, and in some cases I just ignore that char using a dot. Plus, I prevent command substitution with {}:
set find {this\.initNewTransfer.t, n/),}
set replace "this.initNewTransfer(t, n), INJECTED-CODE,"
Just keep in mind the "find" is the regexp and "replace" a simple text.
Let's wait a expert tell us what's the issue.
Regards.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects