diff --git a/inc/core/lib/License.php b/inc/core/lib/License.php index ff8fec4..ca42fc6 100644 --- a/inc/core/lib/License.php +++ b/inc/core/lib/License.php @@ -33,7 +33,7 @@ class License return License::FREE; } - if ($license[0] == md5($license[1].$license[2].$license[3].domain(false))) { + if ($license[0] == md5($license[1].$license[2].$license[3].domain(false, true))) { if (time() < $license[4] || strtotime("-48 hours") > $license[4]) { if (self::remoteCheck($license)) { self::update($license); diff --git a/inc/core/lib/functions.php b/inc/core/lib/functions.php index 2cbcda5..cbcf13f 100644 --- a/inc/core/lib/functions.php +++ b/inc/core/lib/functions.php @@ -250,15 +250,21 @@ function url($data = null) * * @return string */ -function domain($with_protocol = true) +function domain($with_protocol = true, $cut_www = false) { $url = parse_url(url()); - if ($with_protocol) { - return $url['scheme'].'://'.$url['host']; + if ($cut_www) { + $host = str_replace('www.', null, $url['host']); + } else { + $host = $url['host']; } - return $url['host']; + if ($with_protocol) { + return $url['scheme'].'://'.$host; + } + + return $host; } /**