View | Details | Raw Unified | Return to bug 56288
Collapse All | Expand All

(-)a/modules/filters/mod_proxy_html.c (-5 / +13 lines)
Lines 201-207 static void pappend(saxctxt *ctx, const char *buf, const size_t len) Link Here
201
    ctx->offset += len;
201
    ctx->offset += len;
202
}
202
}
203
203
204
static void dump_content(saxctxt *ctx)
204
static void apply_urlmap(saxctxt *ctx)
205
{
205
{
206
    urlmap *m;
206
    urlmap *m;
207
    char *found;
207
    char *found;
Lines 281-287 static void dump_content(saxctxt *ctx) Link Here
281
            }
281
            }
282
        }
282
        }
283
    }
283
    }
284
    AP_fwrite(ctx, ctx->buf, strlen(ctx->buf), 1);
285
}
284
}
286
static void pcdata(void *ctxt, const xmlChar *uchars, int length)
285
static void pcdata(void *ctxt, const xmlChar *uchars, int length)
287
{
286
{
Lines 338-345 static void pendElement(void *ctxt, const xmlChar *uname) Link Here
338
    /* nah.  Keeping the stack is too much overhead */
337
    /* nah.  Keeping the stack is too much overhead */
339
338
340
    if (ctx->offset > 0) {
339
    if (ctx->offset > 0) {
341
        dump_content(ctx);
340
        apply_urlmap(ctx);
342
        ctx->offset = 0;        /* having dumped it, we can re-use the memory */
341
        AP_fwrite(ctx, ctx->buf, strlen(ctx->buf), 1);
342
        ctx->offset = 0;        /* having written the buffer, we can re-use it */
343
    }
343
    }
344
    if (!desc || !desc->empty) {
344
    if (!desc || !desc->empty) {
345
        ap_fprintf(ctx->f->next, ctx->bb, "</%s>", name);
345
        ap_fprintf(ctx->f->next, ctx->bb, "</%s>", name);
Lines 628-633 static void pstartElement(void *ctxt, const xmlChar *uname, Link Here
628
                   anything that needs it in the value.
628
                   anything that needs it in the value.
629
                */
629
                */
630
                ap_fputstrs(ctx->f->next, ctx->bb, " ", a[0], "=\"", NULL);
630
                ap_fputstrs(ctx->f->next, ctx->bb, " ", a[0], "=\"", NULL);
631
                if (!strcasecmp(a[0], "style")) {
632
                    /* apply URL map on attribute value */
633
                    ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0, ctx->f->r,
634
                                  "applying URLMap on style attribute value: '%s'", ctx->buf);
635
                    apply_urlmap(ctx);
636
                }
631
                pcharacters(ctx, (const xmlChar*)ctx->buf, strlen(ctx->buf));
637
                pcharacters(ctx, (const xmlChar*)ctx->buf, strlen(ctx->buf));
632
                ap_fputc(ctx->f->next, ctx->bb, '"');
638
                ap_fputc(ctx->f->next, ctx->bb, '"');
633
            }
639
            }
Lines 1075-1081 static int proxy_css_filter(ap_filter_t *f, apr_bucket_brigade *bb) Link Here
1075
            ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0, f->r, "Processing chunk: [%s]", buf_log);
1081
            ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0, f->r, "Processing chunk: [%s]", buf_log);
1076
1082
1077
            // Replace matching regexps
1083
            // Replace matching regexps
1078
            dump_content(fctx);
1084
            apply_urlmap(fctx);
1085
            AP_fwrite(fctx, fctx->buf, strlen(fctx->buf), 1);
1086
            fctx->offset = 0;        /* having written the buffer, we can re-use it */
1079
        }
1087
        }
1080
        if (APR_BUCKET_IS_EOS(current_bucket)) {
1088
        if (APR_BUCKET_IS_EOS(current_bucket)) {
1081
            APR_BUCKET_REMOVE(current_bucket);
1089
            APR_BUCKET_REMOVE(current_bucket);

Return to bug 56288