Fix license verification

This commit is contained in:
Klocus
2018-06-13 15:25:43 +02:00
parent 1e50ff1057
commit 8c6817ba45
2 changed files with 11 additions and 5 deletions

View File

@@ -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);

View File

@@ -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;
}
/**