projects
/
matthijs
/
upstream
/
blosxom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add hash/hashref interpolation support to blosxom.cgi, and tests.
[matthijs/upstream/blosxom.git]
/
blosxom.cgi
diff --git
a/blosxom.cgi
b/blosxom.cgi
index 638830fe39a4a966c9c59902d44699b9c9097375..4e19e64a27e20e423427d02a3fdf93045d616553 100755
(executable)
--- a/
blosxom.cgi
+++ b/
blosxom.cgi
@@
-510,10
+510,10
@@
sub generate {
# Define default interpolation subroutine
$interpolate = sub {
# Define default interpolation subroutine
$interpolate = sub {
-
package blosxom;
my $template = shift;
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;
};
return $template;
};