| 103 | | print "Content-Type: text/plain; charset=$charset\n\n"; |
|---|
| 104 | | print $app ? $app->translate("Got an error: [_1]", $err) : "Got an error: $err\n"; |
|---|
| | 103 | |
|---|
| | 104 | if ($err =~ m/Missing configuration file/) { |
|---|
| | 105 | my $host = $ENV{SERVER_NAME} || $ENV{HTTP_HOST}; |
|---|
| | 106 | $host =~ s/:\d+//; |
|---|
| | 107 | my $port = $ENV{SERVER_PORT}; |
|---|
| | 108 | my $uri = $ENV{REQUEST_URI} || $ENV{PATH_INFO}; |
|---|
| | 109 | $uri =~ s/mt(\.cgi)?.*$//; |
|---|
| | 110 | my $cgipath = ''; |
|---|
| | 111 | $cgipath = $port == 443 ? 'https' : 'http'; |
|---|
| | 112 | $cgipath .= '://' . $host; |
|---|
| | 113 | $cgipath .= ($port == 443 || $port == 80) ? '' : ':' . $port; |
|---|
| | 114 | $cgipath .= $uri; |
|---|
| | 115 | |
|---|
| | 116 | print "Status: 302 Moved\n"; |
|---|
| | 117 | print "Location: ".$cgipath."mt-wizard.cgi\n\n"; |
|---|
| | 118 | } else { |
|---|
| | 119 | print "Content-Type: text/plain; charset=$charset\n\n"; |
|---|
| | 120 | print $app ? $app->translate("Got an error: [_1]", $err) : "Got an error: $err\n"; |
|---|
| | 121 | } |
|---|