{"thread":{"id":"5154","subject":"[PATCH] gitweb: check if HTTP_ACCEPT is really set","startedAt":"2006-08-06T13:55:02Z","lastAt":"2006-08-06T13:55:02Z","messageCount":1,"participants":["Matthias Lederhofer"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"24889","messageId":"20060806135502.GA13840@moooo.ath.cx","threadId":"5154","inReplyTo":null,"subject":"[PATCH] gitweb: check if HTTP_ACCEPT is really set","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2006-08-06T13:55:02Z","receivedAt":"2006-08-06T13:55:02Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Signed-off-by: Matthias Lederhofer <matled@gmx.net>\n---\nIf the client does not send Accept: HTTP_ACCEPT is undefined and there\nis a warning:\nUse of uninitialized value in pattern match (m//) at line 862.\n---\n gitweb/gitweb.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex f85dc7d..1f4b0f5 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -859,7 +859,7 @@ sub git_header_html {\n \t# 'application/xhtml+xml', otherwise send it as plain old 'text/html'.\n \t# we have to do this because MSIE sometimes globs '*/*', pretending to\n \t# support xhtml+xml but choking when it gets what it asked for.\n-\tif ($cgi->http('HTTP_ACCEPT') =~ m/(,|;|\\s|^)application\\/xhtml\\+xml(,|;|\\s|$)/ && $cgi->Accept('application/xhtml+xml') != 0) {\n+\tif (defined $cgi->http('HTTP_ACCEPT') && $cgi->http('HTTP_ACCEPT') =~ m/(,|;|\\s|^)application\\/xhtml\\+xml(,|;|\\s|$)/ && $cgi->Accept('application/xhtml+xml') != 0) {\n \t\t$content_type = 'application/xhtml+xml';\n \t} else {\n \t\t$content_type = 'text/html';\n-- \n1.4.2.rc3.g2f52\n"}]}