X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND%2FWeb%2FXMLPage.pm;h=b7e70151488fe02f7d40c349e13aa8fe0c0e0fb5;hb=c5cc1151b5a4f1e52eb577a78df1f79dfdc193db;hp=68fd96b246b078f333d9dcd770fc4a432a0c26df;hpb=add4b96ab08441ea81a200af0014a3016df9e1d0;p=ndwebbie.git diff --git a/ND/Web/XMLPage.pm b/ND/Web/XMLPage.pm index 68fd96b..b7e7015 100644 --- a/ND/Web/XMLPage.pm +++ b/ND/Web/XMLPage.pm @@ -79,8 +79,10 @@ sub render : method { $self->process; - my $type = 'application/xhtml+xml'; - $type = 'text/html' if $self->{USER_AGENT} =~ /MSIE/; + my $type = 'text/html'; + if ($self->{HTTP_ACCEPT} =~ m{application/xhtml\+xml}){ + $type = 'application/xhtml+xml' + } my $body; if ($self->{XML}){ $type = 'text/xml'; @@ -93,6 +95,10 @@ sub render : method { $body = $self->render_body($body); + unless ($body){ + return; + } + unless ($self->{XML}){ my $fleetupdate = $DBH->selectrow_array('SELECT landing_tick FROM fleets WHERE uid = ? AND fleet = 0',undef,$self->{UID}); @@ -119,7 +125,6 @@ sub render : method { my ($css) = $DBH->selectrow_array(q{SELECT css FROM users WHERE uid = $1},undef,$ND::UID); $template->param(CSS => $css); $template->param(TITLE => $self->{TITLE}); - } $template->param(Error => $ND::ERROR); $template->param(BODY => $body->output);