You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Doug MacEachern <do...@pobox.com> on 1998/06/26 22:10:37 UTC

[PATCH] mod_include #perl arg interpolation

Based on this message to modperl@apache.org today:

If I have the following in a server parsed .shtml file:

    <!--#set var="FOO" value="BAR" -->
    <!--#perl sub="My::Function" arg="$FOO" -->

I was hoping that My::Function would see "BAR", but instead it sees
"$FOO".
The mod_include docs seem to indicate that the XSSI way is to have my
variable evaluated in double quoted strings when referenced as $FOO or
${FOO} ... 

---

This patch does just that.

-Doug

--- mod_include.c       1998/06/13 15:23:09     1.95
+++ mod_include.c       1998/06/26 20:06:42
@@ -918,6 +918,7 @@
 static int handle_perl(FILE *in, request_rec *r, const char *error)
 {
     char tag[MAX_STRING_LEN];
+    char parsed_string[MAX_STRING_LEN];
     char *tag_val;
     SV *sub = Nullsv;
     AV *av = newAV();
@@ -936,7 +937,8 @@
             sub = newSVpv(tag_val, 0);
         }
         else if (strnEQ(tag, "arg", 3)) {
-            av_push(av, newSVpv(tag_val, 0));
+            parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0);
+            av_push(av, newSVpv(parsed_string, 0));
         }
         else if (strnEQ(tag, "done", 4)) {
             break;