/[Apache-SVN]/httpd/httpd/trunk/modules/filters/mod_include.c
ViewVC logotype

Diff of /httpd/httpd/trunk/modules/filters/mod_include.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 730296, Wed Dec 31 02:27:24 2008 UTC revision 757376, Mon Mar 23 11:12:23 2009 UTC
# Line 537  static void decodehtml(char *s) Line 537  static void decodehtml(char *s)
537      *p = '\0';      *p = '\0';
538  }  }
539    
540  static void add_include_vars(request_rec *r, const char *timefmt)  static void add_include_vars(request_rec *r)
541  {  {
542      apr_table_t *e = r->subprocess_env;      apr_table_t *e = r->subprocess_env;
543      char *t;      char *t;
# Line 565  static void add_include_vars(request_rec Line 565  static void add_include_vars(request_rec
565      }      }
566  }  }
567    
568  static const char *add_include_vars_lazy(request_rec *r, const char *var)  static const char *add_include_vars_lazy(request_rec *r, const char *var, const char *timefmt)
569  {  {
570      char *val;      char *val;
571      if (!strcasecmp(var, "DATE_LOCAL")) {      if (!strcasecmp(var, "DATE_LOCAL")) {
572          include_dir_config *conf =          val = ap_ht_time(r->pool, r->request_time, timefmt, 0);
             (include_dir_config *)ap_get_module_config(r->per_dir_config,  
                                                        &include_module);  
         val = ap_ht_time(r->pool, r->request_time, conf->default_time_fmt, 0);  
573      }      }
574      else if (!strcasecmp(var, "DATE_GMT")) {      else if (!strcasecmp(var, "DATE_GMT")) {
575          include_dir_config *conf =          val = ap_ht_time(r->pool, r->request_time, timefmt, 1);
             (include_dir_config *)ap_get_module_config(r->per_dir_config,  
                                                        &include_module);  
         val = ap_ht_time(r->pool, r->request_time, conf->default_time_fmt, 1);  
576      }      }
577      else if (!strcasecmp(var, "LAST_MODIFIED")) {      else if (!strcasecmp(var, "LAST_MODIFIED")) {
578          include_dir_config *conf =          val = ap_ht_time(r->pool, r->finfo.mtime, timefmt, 0);
             (include_dir_config *)ap_get_module_config(r->per_dir_config,  
                                                        &include_module);  
         val = ap_ht_time(r->pool, r->finfo.mtime, conf->default_time_fmt, 0);  
579      }      }
580      else if (!strcasecmp(var, "USER_NAME")) {      else if (!strcasecmp(var, "USER_NAME")) {
581          if (apr_uid_name_get(&val, r->finfo.user, r->pool) != APR_SUCCESS) {          if (apr_uid_name_get(&val, r->finfo.user, r->pool) != APR_SUCCESS) {
# Line 641  static const char *get_include_var(const Line 632  static const char *get_include_var(const
632          val = apr_table_get(r->subprocess_env, var);          val = apr_table_get(r->subprocess_env, var);
633    
634          if (val == LAZY_VALUE) {          if (val == LAZY_VALUE) {
635              val = add_include_vars_lazy(r, var);              val = add_include_vars_lazy(r, var, ctx->time_str);
636          }          }
637      }      }
638    
# Line 1806  static apr_status_t handle_printenv(incl Line 1797  static apr_status_t handle_printenv(incl
1797          /* get value */          /* get value */
1798          val_text = elts[i].val;          val_text = elts[i].val;
1799          if (val_text == LAZY_VALUE) {          if (val_text == LAZY_VALUE) {
1800              val_text = add_include_vars_lazy(r, elts[i].key);              val_text = add_include_vars_lazy(r, elts[i].key, ctx->time_str);
1801          }          }
1802          val_text = ap_escape_html(ctx->dpool, elts[i].val);          val_text = ap_escape_html(ctx->dpool, elts[i].val);
1803          v_len = strlen(val_text);          v_len = strlen(val_text);
# Line 3005  static apr_status_t includes_filter(ap_f Line 2996  static apr_status_t includes_filter(ap_f
2996           * environment */           * environment */
2997          ap_add_common_vars(r);          ap_add_common_vars(r);
2998          ap_add_cgi_vars(r);          ap_add_cgi_vars(r);
2999          add_include_vars(r, conf->default_time_fmt);          add_include_vars(r);
3000      }      }
3001      /* Always unset the content-length.  There is no way to know if      /* Always unset the content-length.  There is no way to know if
3002       * the content will be modified at some point by send_parsed_content.       * the content will be modified at some point by send_parsed_content.

Legend:
Removed from v.730296  
changed lines
  Added in v.757376

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2