Bug 23290: Allow enabling expand_entities
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 15 Nov 2019 12:41:32 +0000 (12:41 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 25 Feb 2020 13:41:03 +0000 (13:41 +0000)
Since libxml2 disables it now by default, we need to enable it for testing.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Koha/XSLT/Security.pm

index 720c71c..6c75458 100644 (file)
@@ -144,8 +144,9 @@ sub set_parser_options {
     my $conf = $self->{_options};
     return if !$conf;
 
-    if( exists $conf->{expand_entities} && $conf->{expand_entities} eq '0' ) {
-        # we only disable expanding, if we find an explicit 0
+    if( $conf->{expand_entities} ) {
+        _set_option($parser, 'expand_entities', 1);
+    } else {
         _set_option($parser, 'expand_entities', 0);
     }
 }