Page MenuHomePhabricator

Images in dumpHTML broken
Closed, ResolvedPublic

Description

Since the filerepo changes in 1.11, dumpHTML.php no longer properly configures the file URLs. The generated HTML will incorrectly contain absolute URLs instead of relative to the document, and the --image-snapshot feature is broken.

Also, there is no support for arbitrary repository configured via $wgLocalFileRepo and $wgForeignFileRepos, only the legacy globals are used.

A temporary workaround suitable for installations with only one file repository is as follows:

Index: dumpHTML.inc

  • dumpHTML.inc (revision 27666)

+++ dumpHTML.inc (working copy)
@@ -593,7 +593,8 @@

			'src="' . htmlspecialchars( $wgScriptPath ) . '/images', $this->oldCopyrightIcon );

		$wgStylePath = "$wgScriptPath/skins";
  • $wgUploadPath = "$wgScriptPath/{$this->imageRel}";

+ $repo = RepoGroup::singleton()->getLocalRepo();
+ $repo->url = $wgUploadPath = "$wgScriptPath/{$this->imageRel}";

		$wgSharedUploadPath = "$wgUploadPath/shared";
		$wgMaxCredits = -1;
		$wgHideInterlanguageLinks = !$this->interwiki;

Version: 1.11.x
Severity: normal

Details

Reference
bz12122

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:56 PM
bzimport set Reference to bz12122.
bzimport added a subscriber: Unknown Object (MLST).

This is fixed now in the DumpHTML extension.