https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112282
Revision: 112282
Author: aaron
Date: 2012-02-24 01:13:00 +0000 (Fri, 24 Feb 2012)
Log Message:
-----------
Fixes to parserFetchStableFile() hook:
* Do not set $options to have false values for sha1 (or timestamp just in
case). Parser will try to lookup via SHA1 if the sha1 parameter is set, even if
it's set to false. This can mean fetching the file with SHA1 equal to "", which
is apparently code for the Swedish flag...
* Actually append ?filetimestamp= instead of writing over the whole $query var.
Modified Paths:
--------------
trunk/extensions/FlaggedRevs/backend/FlaggedRevs.hooks.php
Modified: trunk/extensions/FlaggedRevs/backend/FlaggedRevs.hooks.php
===================================================================
--- trunk/extensions/FlaggedRevs/backend/FlaggedRevs.hooks.php 2012-02-24
01:00:54 UTC (rev 112281)
+++ trunk/extensions/FlaggedRevs/backend/FlaggedRevs.hooks.php 2012-02-24
01:13:00 UTC (rev 112282)
@@ -193,7 +193,7 @@
$title = Title::makeTitle( NS_FILE, $title->getDBkey()
);
$title->resetArticleId( $title->getArticleId() ); //
avoid extra queries
}
- $time = $sha1 = false; // current version
+ $time = $sha1 = false; // unspecified (defaults to current
version)
# Check for the version of this file used when reviewed...
list( $maybeTS, $maybeSha1 ) =
$incManager->getReviewedFileVersion( $title );
if ( $maybeTS !== null ) {
@@ -209,15 +209,17 @@
$sha1 = $maybeSha1;
}
}
- # Stabilize the file link
- if ( $time ) {
- if ( $query != '' ) $query .= '&';
- $query = "filetimestamp=" . urlencode( wfTimestamp(
TS_MW, $time ) );
- }
- $options['time'] = $time;
- $options['sha1'] = $sha1;
+ # Tell Parser what file version to use
if ( $time === '0' ) {
$options['broken'] = true;
+ } elseif ( $time !== false ) {
+ $options['time'] = $time;
+ $options['sha1'] = $sha1;
+ # Stabilize the file link
+ if ( $query != '' ) {
+ $query .= '&';
+ }
+ $query .= "filetimestamp=" . urlencode( wfTimestamp(
TS_MW, $time ) );
}
return true;
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs