diff options
author | Claude <longneck@scratchbook.ch> | 2017-09-29 13:46:35 +0200 |
---|---|---|
committer | Claude <longneck@scratchbook.ch> | 2017-09-29 13:46:35 +0200 |
commit | cf2b0e373155f0b5c298fcbc0f9c3690e33dc109 (patch) | |
tree | e7f4b48e48e080c4395afd4930be4ac2197c69ee | |
parent | 6bf8243634ef7855d266a35b07dfaa117ebbeead (diff) | |
download | stikked-fit-cf2b0e373155f0b5c298fcbc0f9c3690e33dc109.tar.gz stikked-fit-cf2b0e373155f0b5c298fcbc0f9c3690e33dc109.tar.bz2 stikked-fit-cf2b0e373155f0b5c298fcbc0f9c3690e33dc109.zip |
implemented changes proposed in #422.
-rw-r--r-- | htdocs/application/controllers/Spamadmin.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/htdocs/application/controllers/Spamadmin.php b/htdocs/application/controllers/Spamadmin.php index ac08cff..6fb8ee1 100644 --- a/htdocs/application/controllers/Spamadmin.php +++ b/htdocs/application/controllers/Spamadmin.php @@ -85,8 +85,20 @@ class Spamadmin extends CI_Controller $data = $this->pastes->getSpamLists('spamadmin/' . $ip_address, $seg = 3, $ip_address); $data['ip_address'] = $ip_address; $ip = explode('.', $ip_address); - $ip_firstpart = $ip[0] . '.' . $ip[1] . '.'; - $data['ip_range'] = $ip_firstpart . '*.*'; + + if (count($ip) > 1) + { + $ip_firstpart = $ip[0] . '.' . $ip[1] . '.'; + $data['ip_range'] = $ip_firstpart . '*.*'; + } + else + { + + // ipv6 + $ip = explode(':', $ip_address); + $ip_firstpart = $ip[0] . ':' . $ip[1] . ':' . $ip[2] . ':' . $ip[3] . ':' . $ip[4] . ':' . $ip[5] . ':' . $ip[6]; + $data['ip_range'] = $ip_firstpart . ':*'; + } //view $this->load->view('spam_detail', $data); |