diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index af2613da..ef0c00cc 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -742,11 +742,13 @@ function mod_board_log($board, $page_no = 1, $hide_names = false, $public = fals
error($config['error']['404']);
if (!hasPermission($config['mod']['show_ip'])) {
- // Supports ipv4 only!
+ $ipv4_regex = '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
+ $ipv6_regex = '(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))';
+
+ $ipv4_link_regex = '/(?:)?(' . $ipv4_regex . ')(?:<\/a>)?/';
+ $ipv6_link_regex = '/(?:)?(' . $ipv6_regex . ')(?:<\/a>)?/';
foreach ($logs as $i => &$log) {
- $log['text'] = preg_replace_callback('/(?:)?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:<\/a>)?/', function($matches) {
- return "xxxx";//less_ip($matches[1]);
- }, $log['text']);
+ $log['text'] = preg_replace(array($ipv4_link_regex, $ipv6_link_regex), "xxxx", $log['text']);
}
}