Update config.php

This commit is contained in:
Namhyeon Go 2019-12-05 16:02:15 +09:00 committed by GitHub
parent 65ba89198f
commit 08ccf30f8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,15 +89,15 @@ if(!check_function_exists("get_current_timestamp")) {
// adjust time // adjust time
if(!array_key_empty("adjust", $options)) { if(!array_key_empty("adjust", $options)) {
$units = array(
"s" => array( 1, "second", "seconds"),
"m" => array( 60, "minute", "minutes"),
"h" => array( 120, "hour", "hours" ),
"d" => array(86400, "day", "days" )
);
$adjust = trim($options['adjust']); $adjust = trim($options['adjust']);
$_adjust = ""; $_adjust = "";
if(strlen($adjust) > 0) { if(strlen($adjust) > 0) {
$units = array(
"s" => array( 1, "second", "seconds"),
"m" => array( 60, "minute", "minutes"),
"h" => array( 120, "hour", "hours" ),
"d" => array(86400, "day", "days" )
);
$_L = intval(substr($adjust, 0, -1)); $_L = intval(substr($adjust, 0, -1));
$_R = substr($adjust, -1); $_R = substr($adjust, -1);
if(array_key_exists($_R, $units)) { if(array_key_exists($_R, $units)) {
@ -106,10 +106,11 @@ if(!check_function_exists("get_current_timestamp")) {
} else { } else {
$_adjust = sprintf("%s %s", $_L, $units[$_R][1]); $_adjust = sprintf("%s %s", $_L, $units[$_R][1]);
} }
} else {
$_adjust = $adjust;
} }
$timestamp = strtotime($_adjust, $timestamp);
} }
$timestamp = strtotime($_adjust, $timestamp);
} }
return $timestamp; return $timestamp;