|
|
- function checkdns() {
- global $_G;
- if (empty($_G['siteurl'])) {
- return true;
- }
- $xmlf = importfile();
- $xmlt = @implode('', file($xmlf));
- require_once libfile('class/xml');
- $xmld = xml2array($xmlt);
- $deve = preg_match('(' . $_G['siteurl'] . ')', $xmld['From']);
- if ($deve) {
- return false;
- }
- $matc = parse_url($_G['siteurl']);
- $host = !empty($matc['host']) ? $matc['host'] : $_G['clientip'];
- $clip = gethostbyname($host);
- if ($clip == $host) {
- return true;
- } else {
- return preg_match('#^(10|127|172\.16|192\.168)\.#', $clip);
- }
- }
复制代码
|
|