X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=includes%2FMWTimestamp.php;h=ea91470e852f083200b94df149e74d1d1faac5b3;hb=3191a0b042ec3b375924c9e047974ac7dd1f68ef;hp=26f5e543702cb71df7689f3478ca6142bbbfc75d;hpb=eea755d3babc7148de76efc0a74f700020ceaae2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MWTimestamp.php b/includes/MWTimestamp.php index 26f5e54370..ea91470e85 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 ) ) ) {