diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/request.php | 5 | ||||
-rw-r--r-- | core/translator.php | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/core/request.php b/core/request.php index b2c3e12e..f2fa4d9f 100644 --- a/core/request.php +++ b/core/request.php @@ -43,4 +43,9 @@ class Request return ''; } + + public function isPost() + { + return isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST'; + } } diff --git a/core/translator.php b/core/translator.php index 0f8c3d89..09480111 100644 --- a/core/translator.php +++ b/core/translator.php @@ -52,6 +52,10 @@ namespace Translator { function datetime($format, $timestamp) { + if (! $timestamp) { + return ''; + } + return strftime(get($format, $format), (int) $timestamp); } |