-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakeFileHashes.php
42 lines (36 loc) · 1022 Bytes
/
makeFileHashes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
if (isset($_SERVER['REMOTE_ADDR'])) {
include 'Data/WDGWV/General/WDGWV.php';
if (!(new \WDGWV\General\WDGWV)->debug()) {
exit;
}
}
$hashes = array();
$files = array();
$files = glob("./*.php");
$files = array_merge($files, glob("Data/*.php"));
$files = array_merge($files, glob("Data/*/*.php"));
$files = array_merge($files, glob("Data/*/*/*.php"));
$files = array_merge($files, glob("Data/*/*/*/*.php"));
$files = array_merge($files, glob("Data/*/*/*/*/*.php"));
foreach ($files as $file) {
$hashes[$file] = md5(file_get_contents($file));
}
echo json_encode($hashes);
$fileError = file_put_contents("Data/integrityHashes.db", gzcompress(json_encode($hashes), 9));
if (isset($_GET['returnTo'])) {
echo (
sprintf(
"<script>window.location = '%s?FE=" . ($fileError ? $fileError : 'None') . "';</script>",
$_GET['returnTo']
)
);
exit;
}
echo (
sprintf(
"<script>window.location = '%s';</script>",
"/"
)
);
exit;