Re: [PATCH] gitweb: Make $prevent_xss protection for 'blob_plain' more usable

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

 



Jakub Narebski <jnareb@xxxxxxxxx> writes:

> +	# serve text/* as text/plain
> +	if ($prevent_xss &&
> +	    $type =~ m!^text/([a-z]+)\b(.*)$!) {
> +		my ($subtype, $rest) = ($1, $2);
> +		$rest = defined $rest ? $rest : '';
> +		$type = "text/plain$rest" if ($subtype ne 'plain');

Hmph, wouldn't it be more straightforward if you dropped the statement
modifier?  I.e.

	my ($subtype, $rest) = ($1, $2);
        $rest = '' unless defined $rest;
        $type = "text/plain$rest";

Other than that, looks good to me.

Thanks.
--
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]