Re: [PATCHv6 5/5] gitweb: generate parent..current URLs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 20, 2008 at 12:49 PM, Jakub Narebski <jnareb@xxxxxxxxx> wrote:
>> -             #   - hash or hash_base:/filename
>> +             #   - hash_parent or hash_parent_base:/file_parent
>> +             #   - hash or hash_base:/file_name
>
> Minor nit: this contain independent change 'filename' -> 'file_name',
> but I think it is not worth separating...

Oopsie. Oh well, I was getting so used to all those _  that it felt
strange without

>>               # When the script is the root DirectoryIndex for the domain,
>>               # $href here would be something like http://gitweb.example.com/
>> @@ -778,17 +779,36 @@ sub href (%) {
>>                       delete $params{'action'};
>>               }
>>
>> -             # Finally, we put either hash_base:/file_name or hash
>> +             # Next, we put hash_parent_base:/file_parent..hash_base:/file_name,
>> +             # stripping nonexistent or useless pieces
>> +             $href .= "/" if ($params{'hash_base'} || $params{'hash_parent_base'}
>> +                     || $params{'hash_parent'} || $params{'hash'});
>
> Nice trick (and required change).
>
>>               if (defined $params{'hash_base'}) {
>> -                     $href .= "/".esc_url($params{'hash_base'});
>> -                     if (defined $params{'file_name'}) {
>> +                     if (defined $params{'hash_parent_base'}) {
>> +                             $href .= esc_url($params{'hash_parent_base'});
>> +                             # skip the file_parent if it's the same as the file_name
>> +                             delete $params{'file_parent'} if $params{'file_parent'} eq $params{'file_name'};
>> +                             if (defined $params{'file_parent'} && $params{'file_parent'} !~ /\.\./) {
>> +                                     $href .= ":/".esc_url($params{'file_parent'});
>> +                                     delete $params{'file_parent'};
>> +                             }
>
> Side note: I wonder if we should use esc_url or esc_param here...

esc_url, I would say, allowing us to build RFC-compliant URLs. Isn't
esc_param for CGI?


-- 
Giuseppe "Oblomov" Bilotta
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux