[Koha-patches] [PATCH] translator hack to avoid failure on opac-opensearch.tmpl

Galen Charlton gmcharlt at gmail.com
Thu Oct 7 03:01:57 CEST 2010


Signed-off-by: Galen Charlton <gmcharlt at gmail.com>
---
 misc/translator/TmplTokenizer.pm |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/misc/translator/TmplTokenizer.pm b/misc/translator/TmplTokenizer.pm
index 1413f77..12076e6 100644
--- a/misc/translator/TmplTokenizer.pm
+++ b/misc/translator/TmplTokenizer.pm
@@ -527,7 +527,10 @@ sub _next_token_intermediate {
     if (!$this->cdata_mode_p) {
 	$it = $this->_next_token_internal($h);
 	if (defined $it && $it->type == TmplTokenType::TAG) {
-	    if ($it->string =~ /^<(script|style|textarea)\b/is) {
+	    if ($it->string =~ /^<(script|style|textarea)\b/is ||
+            ($this->filename =~ /opensearch/ && $it->string =~ /^<(description)\b/) # FIXME special case to handle
+                                                                                    # a CDATA in opac-opensearch.tmpl
+           ) {
 		$this->_set_cdata_mode( 1 );
 		$this->_set_cdata_close( "</$1\\s*>" );
 		$this->_set_pcdata_mode( 0 );
-- 
1.7.0



More information about the Koha-patches mailing list