Skip to content

Commit

Permalink
Merge pull request #15 from neayi/fix-bug-14
Browse files Browse the repository at this point in the history
Fixed issue #14
  • Loading branch information
WolfgangFahl authored Jan 24, 2023
2 parents 2b07a1c + 91a8df6 commit 6b796c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion PDFEmbed.hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,16 @@ static public function generateTag($obj, $args = [], Parser $parser, PPFrame $fr
} else {
// https://www.mediawiki.org/wiki/Manual:UserFactory.php
$revUserName = $parser->getRevisionUser();

if (empty($revUserName)) {
return self::error('embed_pdf_invalid_user');
}

$userFactory = MediaWikiServices::getInstance()->getUserFactory();
$user = $userFactory->newFromName($revUserName);
}

if ($user === false) {
if (empty($user)) {
return self::error('embed_pdf_invalid_user');
}

Expand Down

0 comments on commit 6b796c2

Please sign in to comment.