Skip to content

Commit 7ac653c

Browse files
Cleanup block of characters used to prevent browser friendly error pages
1 parent 772671b commit 7ac653c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

deploy.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ function removeLockFile() {
4848
if (!isset($_GET['t']) || $_GET['t'] !== ACCESS_TOKEN) {
4949
header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403);
5050
removeLockFile();
51-
echo '<h2>Access Denied</h2>';
52-
echo '<!--' . str_repeat(" ", 512) . ' -->'; // prevent "friendly" browser error page
51+
echo "<html>\n<body>\n<h2>Access Denied</h2>\n</body>\n</html>\n";
52+
echo "<!--\n~~~~~~~~~~~~~ Prevent browser friendly error page ~~~~~~~~~~~~~~\n" . str_repeat(str_repeat("~", 64) . "\n", 8) . "-->\n";
5353
die();
5454
}
5555
if (count($err) || ACCESS_TOKEN === '' || REMOTE_REPOSITORY === '' || BRANCH === '' || GIT_DIR === '' || TARGET_DIR === '') {
5656
header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403);
5757
removeLockFile();
58-
echo "<h2>Configuration Error</h2>\n<pre>\n" . implode("\n", $err) . "\n</pre>";
59-
echo '<!--' . str_repeat(" ", 512) . ' -->'; // prevent "friendly" browser error page
58+
echo "<html>\n<body>\n<h2>Configuration Error</h2>\n<pre>\n" . implode("\n", $err) . "\n</pre>\n</body>\n</html>\n";
59+
echo "<!--\n~~~~~~~~~~~~~ Prevent browser friendly error page ~~~~~~~~~~~~~~\n" . str_repeat(str_repeat("~", 64) . "\n", 8) . "-->\n";
6060
die();
6161
}
6262
?>

0 commit comments

Comments
 (0)