mirror of
https://github.com/sruupl/batflat.git
synced 2026-02-26 04:50:45 +01:00
Fix license verification
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user