forked from leftypol/leftypol
Casting to make bans work with newer PHP, as per vichan
This commit is contained in:
parent
75f419b948
commit
151bbe7b53
1 changed files with 7 additions and 7 deletions
14
inc/bans.php
14
inc/bans.php
|
@ -47,31 +47,31 @@ class Bans {
|
||||||
|
|
||||||
if (isset($matches[2])) {
|
if (isset($matches[2])) {
|
||||||
// Years
|
// Years
|
||||||
$expire += $matches[2]*60*60*24*365;
|
$expire += (int)$matches[2]*60*60*24*365;
|
||||||
}
|
}
|
||||||
if (isset($matches[4])) {
|
if (isset($matches[4])) {
|
||||||
// Months
|
// Months
|
||||||
$expire += $matches[4]*60*60*24*30;
|
$expire += (int)$matches[4]*60*60*24*30;
|
||||||
}
|
}
|
||||||
if (isset($matches[6])) {
|
if (isset($matches[6])) {
|
||||||
// Weeks
|
// Weeks
|
||||||
$expire += $matches[6]*60*60*24*7;
|
$expire += (int)$matches[6]*60*60*24*7;
|
||||||
}
|
}
|
||||||
if (isset($matches[8])) {
|
if (isset($matches[8])) {
|
||||||
// Days
|
// Days
|
||||||
$expire += $matches[8]*60*60*24;
|
$expire += (int)$matches[8]*60*60*24;
|
||||||
}
|
}
|
||||||
if (isset($matches[10])) {
|
if (isset($matches[10])) {
|
||||||
// Hours
|
// Hours
|
||||||
$expire += $matches[10]*60*60;
|
$expire += (int)$matches[10]*60*60;
|
||||||
}
|
}
|
||||||
if (isset($matches[12])) {
|
if (isset($matches[12])) {
|
||||||
// Minutes
|
// Minutes
|
||||||
$expire += $matches[12]*60;
|
$expire += (int)$matches[12]*60;
|
||||||
}
|
}
|
||||||
if (isset($matches[14])) {
|
if (isset($matches[14])) {
|
||||||
// Seconds
|
// Seconds
|
||||||
$expire += $matches[14];
|
$expire += (int)$matches[14];
|
||||||
}
|
}
|
||||||
|
|
||||||
return time() + $expire;
|
return time() + $expire;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue