mediawiki-extensions-Confir.../includes/hCaptcha/Hooks/ResourceLoaderHooks.php
Reedy 106a63e3b4 hCaptcha: Variablise api and verify urls
Bug: T378207
Change-Id: I62b7a418be4cb3a4a51937ae331a4aad22dc5732
2024-11-06 19:24:04 +00:00

27 lines
606 B
PHP

<?php
declare( strict_types=1 );
namespace MediaWiki\Extension\ConfirmEdit\hCaptcha\Hooks;
use MediaWiki\Config\Config;
use MediaWiki\ResourceLoader as RL;
class ResourceLoaderHooks {
/**
* Passes config variables to ext.confirmEdit.hCaptcha.visualEditor ResourceLoader module.
* @param RL\Context $context
* @param Config $config
* @return array
*/
public static function getHCaptchaResourceLoaderConfig(
RL\Context $context,
Config $config
) {
return [
'hCaptchaSiteKey' => $config->get( 'HCaptchaSiteKey' ),
'hCaptchaScriptURL' => $config->get( 'HCaptchaApiUrl' )
];
}
}