]> git.deb.at Git - pkg/blosxom.git/blobdiff - blosxom.cgi
Add hash/hashref interpolation support to blosxom.cgi, and tests.
[pkg/blosxom.git] / blosxom.cgi
index 638830fe39a4a966c9c59902d44699b9c9097375..4e19e64a27e20e423427d02a3fdf93045d616553 100755 (executable)
@@ -510,10 +510,10 @@ sub generate {
 
     # Define default interpolation subroutine
     $interpolate = sub {
-
         package blosxom;
         my $template = shift;
-        $template =~ s/(\$\w+(?:::\w+)*)/"defined $1 ? $1 : ''"/gee;
+        # Interpolate scalars, namespaced scalars, and hash/hashref scalars
+        $template =~ s/(\$\w+(?:::\w+)*(?:(?:->)?{(['"]?)[-\w]+\2})?)/"defined $1 ? $1 : ''"/gee;
         return $template;
     };