@@ -45,6 +45,20 @@ function removeLockFile() {
45
45
header ("Cache-Control: no-store, no-cache, must-revalidate, max-age=0 " );
46
46
header ("Cache-Control: post-check=0, pre-check=0 " , false );
47
47
header ("Pragma: no-cache " );
48
+ if (!isset ($ _GET ['t ' ]) || $ _GET ['t ' ] !== ACCESS_TOKEN ) {
49
+ header ($ _SERVER ['SERVER_PROTOCOL ' ] . ' 403 Forbidden ' , true , 403 );
50
+ removeLockFile ();
51
+ echo '<h2>Access Denied</h2> ' ;
52
+ echo '<!-- ' . str_repeat ("" , 512 ) . ' --> ' ; // prevent "friendly" browser error page
53
+ die ();
54
+ }
55
+ if (count ($ err ) || ACCESS_TOKEN === '' || REMOTE_REPOSITORY === '' || BRANCH === '' || GIT_DIR === '' || TARGET_DIR === '' ) {
56
+ header ($ _SERVER ['SERVER_PROTOCOL ' ] . ' 403 Forbidden ' , true , 403 );
57
+ 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
60
+ die ();
61
+ }
48
62
?>
49
63
<!DOCTYPE html>
50
64
<html lang="en">
@@ -61,18 +75,6 @@ function removeLockFile() {
61
75
</style>
62
76
</head>
63
77
<body>
64
- <?php
65
- if (!isset ($ _GET ['t ' ]) || $ _GET ['t ' ] !== ACCESS_TOKEN ) {
66
- header ($ _SERVER ['SERVER_PROTOCOL ' ] . ' 403 Forbidden ' , true , 403 );
67
- removeLockFile ();
68
- die ('<h2>Access Denied</h2> ' );
69
- }
70
- if (count ($ err ) || ACCESS_TOKEN === '' || REMOTE_REPOSITORY === '' || BRANCH === '' || GIT_DIR === '' || TARGET_DIR === '' ) {
71
- header ($ _SERVER ['SERVER_PROTOCOL ' ] . ' 403 Forbidden ' , true , 403 );
72
- removeLockFile ();
73
- die ("<h2>Configuration Error</h2> \n<pre> \n" . implode ("\n" , $ err ) . "\n</pre> " );
74
- }
75
- ?>
76
78
<pre>
77
79
<?php
78
80
// The branch
0 commit comments