Skip to content
Permalink
Browse files Browse the repository at this point in the history
remove eval-s
  • Loading branch information
Gemorroj committed Feb 10, 2018
1 parent 8f8d438 commit 91c937e
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/whois.parser.php
Expand Up @@ -102,10 +102,12 @@ function generic_parser_a_blocks($rawdata, $translate, &$disclaimer)
$k = $translate[$k];
if ($k == '') continue;
if (strstr($k, '.')) {
eval("\$block" . getvarname($k) . "=\$v;");
${'block' . getvarname($k)} = $v;
continue;
}
} else $k = strtolower($k);
} else {
$k = strtolower($k);
}

if ($k == 'handle') {
$v = strtok($v, ' ');
Expand Down Expand Up @@ -345,15 +347,16 @@ function generic_parser_b($rawdata, $items = false, $dateformat = 'mdy', $hasreg

if ($pos !== false) {
if ($field != '') {
$var = '$r' . getvarname($field);
$itm = trim(substr($val, $pos + strlen($match)));

if ($itm != '')
eval($var . '="' . str_replace('"', '\"', $itm) . '";');
if ($itm != '') {
${'r' . getvarname($field)} = '="' . str_replace('"', '\"', $itm) . '";';
}
}

if (!$scanall)
if (!$scanall) {
break;
}
}
}
}
Expand Down Expand Up @@ -418,7 +421,8 @@ function get_blocks($rawdata, $items, $partial_match = false, $def_block = false
} else {
$var = getvarname(strtok($field, '#'));
$itm = trim(substr($val, $pos + strlen($match)));
eval('$r' . $var . '=$itm;');

${'r' . $var} = $itm;
}

break;
Expand Down Expand Up @@ -480,7 +484,9 @@ function get_blocks($rawdata, $items, $partial_match = false, $def_block = false

if ($pos !== false) {
$var = getvarname(strtok($field, '#'));
if ($var != '[]') eval('$r' . $var . '=$block;');
if ($var != '[]') {
${'r' . $var} = $block;
}
}
}
}
Expand Down Expand Up @@ -586,7 +592,7 @@ function get_contact($array, $extra_items = '', $has_org = false)
$itm = trim(substr($val, $pos + strlen($match)));

if ($field != '' && $itm != '') {
eval('$r' . getvarname($field) . '=$itm;');
${'r' . getvarname($field)} = $itm;
}

$val = trim(substr($val, 0, $pos));
Expand Down

0 comments on commit 91c937e

Please sign in to comment.