SID-00912: Global search replace breaks greater than sign
| Status: |
Answered |
TWiki version: |
4.1.2 |
Perl version: |
|
| Category: |
GlobalReplacePlugin |
Server OS: |
|
Last update: |
1 year ago |
With the
GlobalReplacePlugin I would like to search for a text and replace it with a <!---start---> tag for including it in another topic. However when I type the greater than and less than sign '>' and '<' in the replace string, it get's expanded to
<
I already tried to escape it with a ! and by typing $gt or $lt, but these don't work.
Does anyone have an idea how to fix the greater than and less than signs?
I'm using TWiki version TWiki-4.1.2, Sat, 03 Mar 2007, build 13046, Plugin API version 1.11
--
MarianneSeverens - 2010-07-25
Discussion and Answer
That is possibly a bug introduced by security-hardening TWiki: <, >, ', ", and % are escaped by default when passed as URL parameters. This is to reduce the exposure to
Wikipedia:Cross-site_request_forgery.
As a temporary fix, try to change the encoding of the URLPARAMs in the SRAHC of the GlobalSearchAndReplace topic. This is untested:
%SEARCH{ search="%URLPARAM{"search" default="do[N]othing" encode="quote"}%" scope="%URLPARAM{"scope"}%" web="%URLPARAM{"web" default="%WEB%"}%" nosearch="on" nototal="on" regex="on" noheader="on" format="$percntGLOBALREPLACE{ func=\"search\" param=\"$web.$topic\" rSearchString=\"%URLPARAM{"rSearchString" encode="quote"}%\" rString=\"%URLPARAM{"rString" encode="quote"}%\" caseSensitive=\"%URLPARAM{"caseSensitive"}%\" }$percnt" separator=" "}%
--
PeterThoeny - 2010-07-25
Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider a
subscription for support or engage one of the
TWiki consultants if you need timely help. We invite you to
get involved with the community, it is more likely you get community support if you support the open source project!
--
PeterThoeny - 2010-09-13
If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.