Файловый менеджер - Редактировать - /var/www/html/mediawiki-1.43.1/extensions/FileImporter/src/Services/FileDescriptionPageValidator.php
Ðазад
<?php namespace FileImporter\Services; use FileImporter\Data\WikitextConversions; use FileImporter\Exceptions\CommunityPolicyException; /** * This class checks a file description page for required and forbidden categories and templates. It * does not have any knowledge about the wikitext syntax. * * @license GPL-2.0-or-later */ class FileDescriptionPageValidator { private WikitextConversions $wikitextConversions; public function __construct( WikitextConversions $conversions ) { $this->wikitextConversions = $conversions; } /** * @param string[] $templates List of case-insensitive page names without namespace prefix * * @throws CommunityPolicyException */ public function validateTemplates( array $templates ) { foreach ( $templates as $template ) { if ( $this->wikitextConversions->isTemplateBad( $template ) ) { throw new CommunityPolicyException( [ 'fileimporter-file-contains-blocked-category-template', $template ] ); } } } /** * @param string[] $categories List of case-insensitive page names without namespace prefix * * @throws CommunityPolicyException */ public function validateCategories( array $categories ): void { foreach ( $categories as $category ) { if ( $this->wikitextConversions->isCategoryBad( $category ) ) { throw new CommunityPolicyException( [ 'fileimporter-file-contains-blocked-category-template', $category ] ); } } } /** * @param string[] $templates List of case-insensitive page names without namespace prefix * * @throws CommunityPolicyException */ public function hasRequiredTemplate( array $templates ) { if ( !$this->wikitextConversions->hasGoodTemplates() ) { return; } foreach ( $templates as $template ) { if ( $this->wikitextConversions->isTemplateGood( $template ) ) { return; } } throw new CommunityPolicyException( [ 'fileimporter-file-missing-required-template' ] ); } }
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка