SID-00912: Global search replace breaks greater than sign
| Status: |
Answered |
TWiki version: |
4.1.2 |
Perl version: |
|
| Category: |
GlobalReplacePlugin |
Server OS: |
|
Last update: |
15 years 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 engaging 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 someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.