jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/395800 )
Change subject: Add option to set source attribute for PDF export ...................................................................... Add option to set source attribute for PDF export When file is retrieved to be exported in PDF, only its "src" attribute is evaluated. This works perfectly for images, but in case of PDF (and other) attachements, it wont work. Added option where caller can set which attribute to look as a source attribute Change-Id: I8de7fbf37e7fd71d446e4607ca40786425cb75df ERM: #8100 --- M UEModulePDF/includes/PDFFileResolver.php 1 file changed, 8 insertions(+), 2 deletions(-) Approvals: Robert Vogel: Looks good to me, approved jenkins-bot: Verified diff --git a/UEModulePDF/includes/PDFFileResolver.php b/UEModulePDF/includes/PDFFileResolver.php index 55a13ac..63631aa 100644 --- a/UEModulePDF/includes/PDFFileResolver.php +++ b/UEModulePDF/includes/PDFFileResolver.php @@ -15,6 +15,11 @@ /** * @var string */ + protected $sSourceAttribute; + + /** + * @var string + */ protected $sFileName = ''; /** @@ -46,9 +51,10 @@ * * @param DOMElement $imgEl */ - public function __construct ( $oImgEl, $sWebrootFileSystemPath ) { + public function __construct ( $oImgEl, $sWebrootFileSystemPath, $sSourceAttribute = 'src' ) { $this->oImgNode= $oImgEl; $this->sWebrootFileSystemPath = $sWebrootFileSystemPath; + $this->sSourceAttribute = $sSourceAttribute; $this->init(); } @@ -72,7 +78,7 @@ $wgScriptPath ); - $sOrigUrl = $this->oImgNode->getAttribute( 'src' ); + $sOrigUrl = $this->oImgNode->getAttribute( $this->sSourceAttribute ); if( strpos( $sOrigUrl, '?' ) ) { $sOrigUrl = substr( $sOrigUrl, 0, strpos( $sOrigUrl, '?' ) ); } -- To view, visit https://gerrit.wikimedia.org/r/395800 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8de7fbf37e7fd71d446e4607ca40786425cb75df Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: REL1_27_dev Gerrit-Owner: Robert Vogel <vo...@hallowelt.biz> Gerrit-Reviewer: ItSpiderman <d.savulje...@gmail.com> Gerrit-Reviewer: Ljonka <l.verhovs...@gmail.com> Gerrit-Reviewer: Mglaser <gla...@hallowelt.biz> Gerrit-Reviewer: Pwirth <wi...@hallowelt.biz> Gerrit-Reviewer: Robert Vogel <vo...@hallowelt.biz> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits