forked from seb26/revquery
-
Notifications
You must be signed in to change notification settings - Fork 1
/
RevQuery-mediawiki-1.17.2.patch
52 lines (52 loc) · 2.02 KB
/
RevQuery-mediawiki-1.17.2.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
diff RevQuery-1.17.2/includes/ImagePage.php RevQuery-1.17.2/includes/ImagePage.php
--- RevQuery-1.17.2/includes/ImagePage.php
+++ RevQuery-1.17.2/includes/ImagePage.php
@@ -978,6 +978,10 @@
$row .= '<span class="history-deleted">' . $url . '</span>';
} else {
$url = $iscur ? $this->current->getUrl() : $this->current->getArchiveUrl( $img );
+ global $wgRevQueryTimestamps;
+ if ( $wgRevQueryTimestamps ) {
+ $url .= '?t=' . $timestamp;
+ }
$row .= Xml::element( 'a', array( 'href' => $url ), $wgLang->timeAndDate( $timestamp, true ) );
}
$row .= "</td>";
diff RevQuery-1.17.2/includes/media/MediaTransformOutput.php RevQuery-1.17.2/includes/media/MediaTransformOutput.php
--- RevQuery-1.17.2/includes/media/MediaTransformOutput.php
+++ RevQuery-1.17.2/includes/media/MediaTransformOutput.php
@@ -178,6 +178,10 @@
$linkAttribs = $this->getDescLinkAttribs( empty( $options['title'] ) ? null : $options['title'], $query );
} elseif ( !empty( $options['file-link'] ) ) {
$linkAttribs = array( 'href' => $this->file->getURL() );
+ global $wgRevQueryTimestamps;
+ if ( $wgRevQueryTimestamps ) {
+ $linkAttribs['href'] .= '?t=' . $this->file->getTimestamp();
+ }
} else {
$linkAttribs = false;
}
@@ -194,6 +198,10 @@
if ( !empty( $options['img-class'] ) ) {
$attribs['class'] = $options['img-class'];
}
+ global $wgRevQueryTimestamps;
+ if ( $wgRevQueryTimestamps ) {
+ $attribs['src'] .= '?t=' . $this->file->getTimestamp();
+ }
return $this->linkWrap( $linkAttribs, Xml::element( 'img', $attribs ) );
}
diff RevQuery-1.17.2/includes/Linker.php RevQuery-1.17.2/includes/Linker.php
--- RevQuery-1.17.2/includes/Linker.php
+++ RevQuery-1.17.2/includes/Linker.php
@@ -763,6 +763,10 @@
$img = wfFindFile( $title, array( 'time' => $time ) );
if ( $img ) {
$url = $img->getURL();
+ global $wgRevQueryTimestamps;
+ if ( $wgRevQueryTimestamps ) {
+ $url .= '?t=' . $img->getTimestamp();
+ }
$class = 'internal';
} else {
$url = $this->getUploadUrl( $title );