Followup I68eb9f27
No caller of wfTimestamp can handle the exception, false is always used,
as the method comment says.
See bug 40037 for File related timestamps.
The api result is also not b/c:
<api servedby="mw70">
<error code="internal_api_error_TimestampException" info="Exception
Caught: MWTimestamp::setTimestamp : Invalid timestamp - te"
xml:space="preserve" />
</api>
Change-Id: I1e8c785941d35678f3d12824bdde0ce245572592
* @return Mixed: String / false The same date in the format specified in $outputtype or false
*/
function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) {
- $timestamp = new MWTimestamp( $ts );
- return $timestamp->getTimestamp( $outputtype );
+ try {
+ $timestamp = new MWTimestamp( $ts );
+ return $timestamp->getTimestamp( $outputtype );
+ } catch( TimestampException $e ) {
+ wfDebug("wfTimestamp() fed bogus time value: TYPE=$outputtype; VALUE=$ts\n");
+ return false;
+ }
}
/**
/**
* File has an invalid time (+ one valid but really weird time)
* that shouldn't be included
- * @expectedException TimestampException
*/
public function testIPTCDatesInvalid() {
$meta = BitmapMetadataHandler::Jpeg( $this->filePath .