diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /includes/MWTimestamp.php | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'includes/MWTimestamp.php')
-rw-r--r-- | includes/MWTimestamp.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/includes/MWTimestamp.php b/includes/MWTimestamp.php index 26f5e543..ea91470e 100644 --- a/includes/MWTimestamp.php +++ b/includes/MWTimestamp.php @@ -182,6 +182,11 @@ class MWTimestamp { $output .= ' GMT'; } + if ( $style == TS_MW && strlen( $output ) !== 14 ) { + throw new TimestampException( __METHOD__ . ': The timestamp cannot be represented in ' . + 'the specified format' ); + } + return $output; } @@ -221,7 +226,7 @@ class MWTimestamp { $offsetRel = $relativeTo->offsetForUser( $user ); $ts = ''; - if ( wfRunHooks( 'GetHumanTimestamp', array( &$ts, $this, $relativeTo, $user, $lang ) ) ) { + if ( Hooks::run( 'GetHumanTimestamp', array( &$ts, $this, $relativeTo, $user, $lang ) ) ) { $ts = $lang->getHumanTimestamp( $this, $relativeTo, $user ); } @@ -326,7 +331,7 @@ class MWTimestamp { $ts = ''; $diff = $this->diff( $relativeTo ); - if ( wfRunHooks( + if ( Hooks::run( 'GetRelativeTimestamp', array( &$ts, &$diff, $this, $relativeTo, $user, $lang ) ) ) { |