On Mar 12, 2004, at 11:01 AM, Andre Breiler wrote:

Hi,

On Fri, 12 Mar 2004, Brian Pane wrote:

That definitely sounds useful.  I think you can get the same effect,
though, by using the existing 2.0/2.1 mod_include hook to add new
directives... something like this:
     <!--#set_random var="blah" min="$min" max="$max" -->

That's not quite as syntactically elegant, but it has the advantage
of not requiring any new parsing code.  What do you think?

Yes that was one of my other ideas as well :) The reason I asked for the below first was that it makes it a little more easier for the html author and that other modules which might use ap_ssi_parse_string won't get the benefit of functions. In addition I was thinking about a function "eval" feeding the content of a variable into ap_ssi_parse_string again. The last minor thought was that I wouldn't have to replicate most of the #set code again.

The third idea (which we use atm.) is:
<!--#set var="blah" function="random" value="$min" value="$max">
.
I really don't like that one as it means that I have to modify #set
without getting a benefit.

What speaks for your idea is that here wouldn't be any code changes to
existing code needed and that it prevent dump users even getting near
recursions.

Let me know what you think if I should go for the more flexible (imho) or
the safer way.

I like the "<!--#set_random_var ..." approach best because it doesn't require new parsing code, and mod_include's parser is very complex already. On the other hand, adding function support within ap_ssi_parse_string would only require very localized changes, so it would be low-risk. I think either approach would be reasonably safe.

Brian



Reply via email to