httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/modules/filters mod_include.c
Date Mon, 31 Dec 2001 06:04:46 GMT
wrowe       01/12/30 22:04:46

  Modified:    modules/filters mod_include.c
  Log:
    To provide more flexibility in handling quotes, allow the backtick quote
    for SSI tag arguments (e.g. <!--#echo val=`foo` -->).  This helps with
    arguments containing both single and double quotes.
  
  Revision  Changes    Path
  1.180     +16 -8     httpd-2.0/modules/filters/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
  retrieving revision 1.179
  retrieving revision 1.180
  diff -u -r1.179 -r1.180
  --- mod_include.c	31 Dec 2001 06:01:09 -0000	1.179
  +++ mod_include.c	31 Dec 2001 06:04:45 -0000	1.180
  @@ -806,7 +806,7 @@
    * The tag value is html decoded if dodecode is non-zero.
    * The tag value may be NULL if there is no tag value..
    *    format:
  - *        [WS]<Tag>[WS]=[WS]['|"]<Value>['|"|WS]
  + *        [WS]<Tag>[WS]=[WS]['|"|`]<Value>[['|"|`|]|WS]
    */
   
   #define SKIP_TAG_WHITESPACE(ptr) while ((*ptr != '\0') && (apr_isspace (*ptr)))
ptr++
  @@ -857,20 +857,28 @@
       }
   
       SKIP_TAG_WHITESPACE(c);
  -    if (*c == '"' || *c == '\'') { 
  -        /* Allow quoted values for space inclusion. */
  -        term = *c++;     /* NOTE: This does not pass the quotes on return. */
  +    if (*c == '"' || *c == '\'' || *c == '`') { 
  +        /* Allow quoted values for space inclusion. 
  +         * NOTE: This does not pass the quotes on return.
  +         */
  +        term = *c++;
       }
       
       *tag_val = c;
       while ((*c != '\0') &&
              (((term != '\0') && (*c != term)) ||
               ((term == '\0') && (!apr_isspace(*c))))) {
  -        if (*c == '\\') {  /* Accept \" and \' as valid char in string. */
  +        /* Accept \" (or ' or `) as valid quotation of string. 
  +         */
  +        if (*c == '\\') {  
  +            /* Overwrite the "\" during the embedded 
  +             * escape sequence of '"'. "\'" or '`'. 
  +             * Shift bytes from here to next delimiter.     
  +             */
               c++;
  -            if (*c == term) { /* Overwrite the "\" during the embedded  */
  -                shift_val++;  /* escape sequence of '\"' or "\'". Shift */
  -            }                 /* bytes from here to next delimiter.     */
  +            if (*c == term) {
  +                shift_val++;
  +            }
               if (shift_val > 0) {
                   *(c-shift_val) = *c;
               }
  
  
  

Mime
View raw message