Bug 65287 - balance-manager app produces bad html - no space between attributes
Summary: balance-manager app produces bad html - no space between attributes
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy_balancer (show other bugs)
Version: 2.5-HEAD
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2021-05-04 16:00 UTC by Todd Lewis
Modified: 2021-05-04 16:49 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Todd Lewis 2021-05-04 16:00:41 UTC
The internal balance-manager app produces HTML with no space between a couple of attributes. This occurs in 4 lines in modules/proxy/mod_proxy_balancer.c starting around line (current) line 1804.


ap_rprintf(r, "<tr><td>Interval (ms)</td><td><input name='w_hi' id='w_hi' type='text'"
           "value='%" APR_TIME_T_FMT "'></td></tr>\n", apr_time_as_msec(wsel->s->interval));
ap_rprintf(r, "<tr><td>Passes trigger</td><td><input name='w_hp' id='w_hp' type='text'"
           "value='%d'></td></tr>\n", wsel->s->passes);
ap_rprintf(r, "<tr><td>Fails trigger)</td><td><input name='w_hf' id='w_hf' type='text'"
           "value='%d'></td></tr>\n", wsel->s->fails);
ap_rprintf(r, "<tr><td>HC uri</td><td><input name='w_hu' id='w_hu' type='text'"
           "value=\"%s\"></td></tr>\n", ap_escape_html(r->pool, wsel->s->hcuri));

The trailing "type='text'" bumps into the next lines' leading "value=".

Suggested fix (which also removes some unneeded single quotes) adds a space after type=text:

ap_rprintf(r, "<tr><td>Interval (ms)</td><td><input name=w_hi id=w_hi type=text "
           "value='%" APR_TIME_T_FMT "'></td></tr>\n", apr_time_as_msec(wsel->s->interval));
ap_rprintf(r, "<tr><td>Passes trigger</td><td><input name=w_hp id=w_hp type=text "
           "value='%d'></td></tr>\n", wsel->s->passes);
ap_rprintf(r, "<tr><td>Fails trigger)</td><td><input name=w_hf id=w_hf type=text "
           "value='%d'></td></tr>\n", wsel->s->fails);
ap_rprintf(r, "<tr><td>HC uri</td><td><input name=w_hu id=w_hu type=text "
           "value=\"%s\"></td></tr>\n", ap_escape_html(r->pool, wsel->s->hcuri));
Comment 1 Christophe JAILLET 2021-05-04 16:49:28 UTC

thx for the feed back. Applied on trunk : r1889494.

I've left the '', because up to now, the 2.4.x branch generates some 3.2 HTML code and '_' in CDATA is not allowed there.

(even if I agree that 3.2 is really out-dated and that any recent browser would certainly not even notice some missing ' here)