httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Raoult <brao...@gmail.com>
Subject Re: Description CSS class missing for empty desc / Missing directory description
Date Sat, 25 Oct 2014 21:53:21 GMT
On Sat, Oct 25, 2014 at 11:34 PM, Bruno Raoult <braoult@gmail.com> wrote:

> On Sat, Oct 25, 2014 at 10:58 PM, Bruno Raoult <braoult@gmail.com> wrote:
>
>> Hi,
>>
>> I am very sorry to be new on this list, and looking at the code to
>> understand it will take a few more days.
>>
>> However, the problems I can see in mod_autoindex.c are the following
>> (they are related):
>> 1) The "^^DIRECTORY^^" check for icon is not available for description. I
>> think Icon and Description should follow the same rules.
>> 2) Using "IndexStyleSheet" option does not set any CSS class when
>> description is empty
>>
>> Therefore, it is impossible (for instance) to hide the "Description"
>> column with pure CSS (as empty descs will have no CSS class).
>>
>> I suppose this was omitted on purpose, or maybe a bug? Before going on
>> source code, I would like to know more about this decision to have icons
>> and description having different algorithms.
>>
>
> For (2) I believe the problem could be lines 1773-1786  (code version
> 2.4.6), and the block itself: Class is not emitted if ar[x]->desc is null
> (line 1785).
>

May I suggest line 1785 something like:
           ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? "
class=\"indexcoldesc\">" : ">", "&nbsp;", r);
instead of:
           ap_rputs("</td><td>&nbsp;", r);

Or inserting a line before the 1773 to set ar[x]->desc to "&nbsp;" if desc
null, and remove part of the following test (this seems easier to read for
me).

I am just afraid of side effects, so I would prefer somebody else to double
check :)

br.

-- 
2 + 2 = 5, for very large values of 2.

Mime
View raw message