Simplify check for special page UploadWizard

Use build in function Title::isSpecial instead of testing if name is
identical or subpage of the special page title.

Change-Id: Iaf7d42267a6b6bb16201fe5859dd0d9e72c0fd9b
这个提交包含在:
Umherirrender 2024-01-20 01:31:47 +01:00
父节点 eb9b2866dd
当前提交 eb8ba5cb62

查看文件

@ -26,7 +26,6 @@ use MediaWiki\Hook\UploadForm_getInitialPageTextHook;
use MediaWiki\Hook\UploadFormInitDescriptorHook;
use MediaWiki\MediaWikiServices;
use MediaWiki\Output\OutputPage;
use MediaWiki\SpecialPage\SpecialPage;
use RequestContext;
use Skin;
@ -72,8 +71,7 @@ class Hooks implements
// fallback when no JS is available...
$context = RequestContext::getMain();
$title = $context->getTitle();
$titleUW = SpecialPage::getTitleFor( 'UploadWizard' );
$addJs = $title && !$title->equals( $titleUW ) && !$title->isSubpageOf( $titleUW );
$addJs = $title && !$title->isSpecial( 'UploadWizard' );
$patentDescriptor = [
'Patent' => [