Skip to content

Commit 49b3e14

Browse files
authored
Issue #3: check headers already sent (#13)
1 parent 1ba1d1a commit 49b3e14

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

httpbl.module

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ function httpbl_boot() {
147147

148148
$message = strtr($message, array('%ip' => ip_address(), '%ipurl' => _httpbl_ipdata(ip_address(), FALSE), '%honeypot' => $link, '%whitelisturl' => _httpbl_url('/httpbl/whitelist')));
149149

150-
header('HTTP/1.1 403 Forbidden');
150+
if (!headers_sent()) {
151+
header('HTTP/1.1 403 Forbidden');
152+
}
153+
151154
echo $message;
152155
exit();
153156
}

0 commit comments

Comments
 (0)