Merge "(bug 40098) Don't parse the section's name in the summary when creating a...
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index e600506..17e3f4d 100644 (file)
@@ -1542,8 +1542,6 @@ function wfMsgGetKey( $key, $useDB = true, $langCode = false, $transform = true
 /**
  * Replace message parameter keys on the given formatted output.
  *
- * @deprecated since 1.18
- *
  * @param $message String
  * @param $args Array
  * @return string
@@ -2411,8 +2409,13 @@ define( 'TS_ISO_8601_BASIC', 9 );
  * @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;
+       }
 }
 
 /**