#51 IP 일부를 가릴 때 처리 개선.

This commit is contained in:
ngleader 2013-11-15 13:40:18 +09:00 committed by bnu
parent d264bca4c2
commit 8ea446d74b
2 changed files with 7 additions and 3 deletions

View file

@ -229,7 +229,7 @@ class commentItem extends Object
return $this->get('ipaddress'); return $this->get('ipaddress');
} }
return preg_replace('/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/', '*.$2.$3.$4', $this->get('ipaddress')); return '*' . strstr($this->get('ipaddress'), '.');
} }
function isExistsHomepage() function isExistsHomepage()

View file

@ -276,8 +276,12 @@ class documentItem extends Object
function getIpAddress() function getIpAddress()
{ {
if($this->isGranted()) return $this->get('ipaddress'); if($this->isGranted())
return preg_replace('/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/','*.$2.$3.$4', $this->get('ipaddress')); {
return $this->get('ipaddress');
}
return '*' . strstr($this->get('ipaddress'), '.');
} }
function isExistsHomepage() function isExistsHomepage()