Bug 65287

Summary: balance-manager app produces bad html - no space between attributes
Product: Apache httpd-2 Reporter: Todd Lewis <utoddl>
Component: mod_proxy_balancerAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.5-HEAD   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

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.

Currently:

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
Hi,

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)