forked from Th3-822/rapidleech
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrc32.php
More file actions
32 lines (32 loc) · 1.33 KB
/
Copy pathcrc32.php
File metadata and controls
32 lines (32 loc) · 1.33 KB
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
<?php
function rl_crc32() {
global $list;
?>
<table class="md5table" align="center" border="0" cellspacing="2" cellpadding="4">
<tr>
<th align="center"><?php echo lang(104); ?></th>
<th align="center"><?php echo lang(56); ?></th>
<th align="center">CRC32</th>
</tr>
<?php
foreach ($_GET['files'] as $v) {
$file = empty($list[$v]) ? '' : $list[$v];
if (!empty($file) && file_exists($file['name'])) {
$name = basename($file['name']);
$crc = strtoupper(hash_file('crc32b', $file['name']));
if (preg_match("@[\(_\{]($crc)[\}_\)]@i", $name)) $tstyle = ' style="color: green" title="'.lang(391).'">';
elseif (preg_match('@\[([a-fA-F0-9]{8})\]@', $name, $fcrc) || preg_match('@_([a-fA-F0-9]{8})_@', $name, $fcrc) || preg_match('@\(([a-fA-F0-9]{8})\)@', $name, $fcrc) || preg_match('@\{([a-fA-F0-9]{8})\}@', $name, $fcrc)) {
$tstyle = ((!empty($fcrc[2]) || strtoupper($fcrc[1]) == $crc) ? ' style="color: green" title="'.lang(391).'">' : ' style="color: red" title="'.sprintf(lang(392),$fcrc[1]).'">');
} else $tstyle = '>';
?>
<tr>
<td nowrap="nowrap"> <b><?php echo htmlspecialchars($name); ?></b> </td>
<td align="center"> <?php echo $file['size']; ?> </td>
<td nowrap="nowrap"> <b<?php echo "$tstyle$crc" ?></b> </td>
</tr>
<?php
}
}
echo "</table>\n<br />";
}
?>