diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 2618325333d..a3d4fa0fa6f 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -854,8 +854,16 @@ function wfAcceptToPrefs( $accept, $def = '*/*' ) { } /** - * @todo document - * @private + * Checks if a given MIME type matches any of the keys in the given + * array. Basic wildcards are accepted in the array keys. + * + * Returns the matching MIME type (or wildcard) if a match, otherwise + * NULL if no match. + * + * @param string $type + * @param array $avail + * @return string + * @access private */ function mimeTypeMatch( $type, $avail ) { if( array_key_exists($type, $avail) ) { @@ -873,6 +881,15 @@ function mimeTypeMatch( $type, $avail ) { } /** + * Returns the 'best' match between a client's requested internet media types + * and the server's list of available types. Each list should be an associative + * array of type to preference (preference is a float between 0.0 and 1.0). + * Wildcards in the types are acceptable. + * + * @param array $cprefs Client's acceptable type list + * @param array $sprefs Server's offered types + * @return string + * * @todo FIXME: doesn't handle params like 'text/plain; charset=UTF-8' * XXX: generalize to negotiate other stuff */ @@ -923,31 +940,13 @@ function wfArrayLookup( $a, $b ) { return array_flip( array_intersect( array_flip( $a ), array_keys( $b ) ) ); } - /** - * Ideally we'd be using actual time fields in the db - * @todo fixme - */ -function wfTimestamp2Unix( $ts ) { - return gmmktime( ( (int)substr( $ts, 8, 2) ), - (int)substr( $ts, 10, 2 ), (int)substr( $ts, 12, 2 ), - (int)substr( $ts, 4, 2 ), (int)substr( $ts, 6, 2 ), - (int)substr( $ts, 0, 4 ) ); -} - -/** - * @todo document - */ -function wfUnix2Timestamp( $unixtime ) { - return gmdate( 'YmdHis', $unixtime ); -} - -/** - * @todo document + * Convenience function; returns MediaWiki timestamp for the present time. + * @return string */ function wfTimestampNow() { # return NOW - return gmdate( 'YmdHis' ); + return wfTimestamp( TS_MW, time() ); } /** diff --git a/includes/RawPage.php b/includes/RawPage.php index aa21d8311d1..aa22d2b007a 100644 --- a/includes/RawPage.php +++ b/includes/RawPage.php @@ -115,7 +115,7 @@ class RawPage { $res = $dbr->query( $sql, $fname ); if( $s = $dbr->fetchObject( $res ) ) { $rawtext = Article::getRevisionText( $s, "" ); - header( 'Last-modified: '.gmdate( "D, j M Y H:i:s", wfTimestamp2Unix( $s->timestamp )).' GMT' ); + header( 'Last-modified: '.gmdate( "D, j M Y H:i:s", wfTimestamp( TS_UNIX, $s->timestamp )).' GMT' ); return $rawtext; } else { return ''; diff --git a/includes/SpecialValidate.php b/includes/SpecialValidate.php index 23bf6f62eab..aaaac55c41a 100644 --- a/includes/SpecialValidate.php +++ b/includes/SpecialValidate.php @@ -204,7 +204,7 @@ class Validation { if ( $article_time == $time ) { $tablestyle .=" style='border: 2px solid red'"; } - $html .= "