From dd64903489a264e6e0c83035ab5b631f51f20507 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 11 Feb 2014 16:29:13 +0100 Subject: [PATCH] Bug 11741: Correct display of < > in XSLT result lists < and > are incorrectly transformed into HTML entities on the XSLT result list when using the GRS-1 indexing mode. Example: Record: Result list: <TEST> HTML source: &lt;TEST&gt To test: - catalog a record that contains > and < - Reindex, without using the -x option - Confirm the display is correct - Reindex again, using the -x option - Confirm the display is now broken - Apply patch - Reindex again with and without -x - Verify that now the display is always correct Signed-off-by: Tomas Cohen Arazi Note: the problem is only visible in GRS-1 setup. It works as expected. No behaviour change in DOM. I believe we shouldn't be (de)escaping data ad-hoc, but it seems that GRS-1 needs it because it doesn't handle HTML entities properly. This fix is OK for GRS-1, unneeded for DOM and probably any other modern search engine. Signed-off-by: Martin Renvoize Signed-off-by: Galen Charlton --- C4/XSLT.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index d85b0486cd..163b5a42a8 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -215,8 +215,10 @@ sub XSLTParse4Display { } $sysxml .= "\n"; $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/; - if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs + if ($fixamps) { # We need to correct the HTML entities that Zebra outputs $xmlrecord =~ s/\&amp;/\&/g; + $xmlrecord =~ s/\&\;lt\;/\<\;/g; + $xmlrecord =~ s/\&\;gt\;/\>\;/g; } $xmlrecord =~ s/\& /\&\; /; $xmlrecord =~ s/\&\;amp\; /\&\; /; -- 2.39.2