mirror of
https://github.com/tursom/typecho-plugin-Access.git
synced 2024-12-26 21:00:12 +08:00
修改 long2ip 在 PHP7 之中的兼容性问题
This commit is contained in:
parent
dd3ee029c7
commit
08a08185a8
@ -459,5 +459,16 @@ class Access_Core
|
||||
'meta_id' => $meta_id,
|
||||
);
|
||||
}
|
||||
|
||||
public function long2ip($long) {
|
||||
if ($long < 0 || $long > 4294967295) return false;
|
||||
$ip = "";
|
||||
for ($i=3;$i>=0;$i--) {
|
||||
$ip .= (int)($long / pow(256,$i));
|
||||
$long -= (int)($long / pow(256,$i))*pow(256,$i);
|
||||
if ($i>0) $ip .= ".";
|
||||
}
|
||||
return $ip;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ $access = new Access_Core();
|
||||
<td><input type="checkbox" data-id="<?php echo $log['id']; ?>" value="<?php echo $log['id']; ?>" name="id[]"/></td>
|
||||
<td><a target="_self" href="<?php $options->adminUrl('extending.php?panel=' . Access_Plugin::$panel . '&filter=path&path=' . $log['path'] . '&type='. $request->type); ?>"><?php echo urldecode(str_replace("%23", "#", $log['url'])); ?></a></td>
|
||||
<td><a data-action="ua" href="#" title="<?php echo $log['ua'];?>"><?php echo $log['display_name']; ?></a></td>
|
||||
<td><a data-action="ip" data-ip="<?php echo long2ip($log['ip']); ?>" href="#"><?php echo long2ip($log['ip']); ?></a><?php if($request->filter != 'ip'): ?> <a target="_self" href="<?php $options->adminUrl('extending.php?panel=' . Access_Plugin::$panel . '&filter=ip&ip=' . long2ip($log['ip']) . '&type='. $request->type); ?>">[ ? ]</a><?php endif; ?></td>
|
||||
<td><a data-action="ip" data-ip="<?php echo $access->long2ip($log['ip']); ?>" href="#"><?php echo $access->long2ip($log['ip']); ?></a><?php if($request->filter != 'ip'): ?> <a target="_self" href="<?php $options->adminUrl('extending.php?panel=' . Access_Plugin::$panel . '&filter=ip&ip=' . $access->long2ip($log['ip']) . '&type='. $request->type); ?>">[ ? ]</a><?php endif; ?></td>
|
||||
<td><a target="_blank" data-action="referer" href="<?php echo $log['referer']; ?>"><?php echo $log['referer']; ?></a></td>
|
||||
<td><?php echo date('Y-m-d H:i:s',$log['time']); ?></td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user