aboutsummaryrefslogtreecommitdiffstats
path: root/includes/logging
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2021-10-16 23:47:01 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2022-01-11 20:13:13 +0100
commit95852cb22bd574533b019e8d3f7ccd507fc25291 (patch)
treee7f246b0e05bddf66b2b33d99511c63cb070fd1e /includes/logging
parent5d23bca5a556246be82e921a4b9895e7e519064a (diff)
downloadmediawikicore-95852cb22bd574533b019e8d3f7ccd507fc25291.tar.gz
mediawikicore-95852cb22bd574533b019e8d3f7ccd507fc25291.zip
Explicit cast TS_UNIX to int for arithmetic operations and int args
When the called function has a doc of int, it should be cast to be explicit here. Also cast for arithmetic operations to be explicit about the number Change-Id: I905b78dfb66e66443e0e3203488bab5b548db543
Diffstat (limited to 'includes/logging')
-rw-r--r--includes/logging/BlockLogFormatter.php4
-rw-r--r--includes/logging/LogFormatter.php4
2 files changed, 4 insertions, 4 deletions
diff --git a/includes/logging/BlockLogFormatter.php b/includes/logging/BlockLogFormatter.php
index d975dea7f77f..77fbfa30a5e3 100644
--- a/includes/logging/BlockLogFormatter.php
+++ b/includes/logging/BlockLogFormatter.php
@@ -63,7 +63,7 @@ class BlockLogFormatter extends LogFormatter {
$blockExpiry = $this->context->getLanguage()->translateBlockExpiry(
$params[4],
$this->context->getUser(),
- wfTimestamp( TS_UNIX, $this->entry->getTimestamp() )
+ (int)wfTimestamp( TS_UNIX, $this->entry->getTimestamp() )
);
if ( $this->plaintext ) {
$params[4] = Message::rawParam( $blockExpiry );
@@ -276,7 +276,7 @@ class BlockLogFormatter extends LogFormatter {
}
if ( !wfIsInfinity( $params['5::duration'] ) ) {
- $ts = wfTimestamp( TS_UNIX, $entry->getTimestamp() );
+ $ts = (int)wfTimestamp( TS_UNIX, $entry->getTimestamp() );
$expiry = strtotime( $params['5::duration'], $ts );
if ( $expiry !== false && $expiry > 0 ) {
$params[':timestamp:expiry'] = $expiry;
diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php
index 28679068cb73..144cdd24915e 100644
--- a/includes/logging/LogFormatter.php
+++ b/includes/logging/LogFormatter.php
@@ -405,7 +405,7 @@ class LogFormatter {
$duration = $contLang->translateBlockExpiry(
$rawDuration,
null,
- wfTimestamp( TS_UNIX, $entry->getTimestamp() )
+ (int)wfTimestamp( TS_UNIX, $entry->getTimestamp() )
);
$flags = BlockLogFormatter::formatBlockFlags( $rawFlags, $contLang );
$text = wfMessage( 'blocklogentry' )
@@ -419,7 +419,7 @@ class LogFormatter {
$duration = $contLang->translateBlockExpiry(
$parameters['5::duration'],
null,
- wfTimestamp( TS_UNIX, $entry->getTimestamp() )
+ (int)wfTimestamp( TS_UNIX, $entry->getTimestamp() )
);
$flags = BlockLogFormatter::formatBlockFlags( $parameters['6::flags'],
$contLang );