Replaced eregi() with preg_match() and get_class() for thirdparty

This commit is contained in:
abraar
2010-12-10 14:12:24 +00:00
parent 96abdb996a
commit f4dbb31aa1

View File

@@ -212,7 +212,7 @@ class Net_IPv4
/*
* a hexadecimal string was entered
*/
if (eregi("^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$", $parts[1], $regs)) {
if (preg_match("/([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/", $parts[1], $regs)) {
// hexadecimal string
$myself->netmask = hexdec($regs[1]) . "." . hexdec($regs[2]) . "." .
hexdec($regs[3]) . "." . hexdec($regs[4]);
@@ -394,7 +394,7 @@ class Net_IPv4
*/
function htoa($addr)
{
if (eregi("^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$",
if (preg_match("/([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/",
$addr, $regs)) {
return hexdec($regs[1]) . "." . hexdec($regs[2]) . "." .
hexdec($regs[3]) . "." . hexdec($regs[4]);