芝麻web文件管理V1.00
编辑当前文件:/home/rejoandoctor/www/vendor/biscolab/laravel-recaptcha/src/ReCaptchaBuilderV2.php
tag * * @param null|array $attributes * @return string */ public function htmlFormSnippet(?array $attributes = []): string { $data_attributes = []; $config_data_attributes = array_merge($this->getTagAttributes(), self::cleanAttributes($attributes)); ksort($config_data_attributes); foreach ($config_data_attributes as $k => $v) { if ($v) { $data_attributes[] = 'data-' . $k . '="' . $v . '"'; } } $html = '
'; return $html; } /** * @return array * @throws InvalidConfigurationException */ public function getTagAttributes(): array { $tag_attributes = [ 'sitekey' => $this->api_site_key ]; $tag_attributes = array_merge($tag_attributes, config('recaptcha.tag_attributes', [])); if (Arr::get($tag_attributes, 'callback') === ReCaptchaBuilder::DEFAULT_ONLOAD_JS_FUNCTION) { throw new InvalidConfigurationException('Property "callback" ("data-callback") must be different from "' . ReCaptchaBuilder::DEFAULT_ONLOAD_JS_FUNCTION . '"'); } if (Arr::get($tag_attributes, 'expired-callback') === ReCaptchaBuilder::DEFAULT_ONLOAD_JS_FUNCTION) { throw new InvalidConfigurationException('Property "expired-callback" ("data-expired-callback") must be different from "' . ReCaptchaBuilder::DEFAULT_ONLOAD_JS_FUNCTION . '"'); } if (Arr::get($tag_attributes, 'error-callback') === ReCaptchaBuilder::DEFAULT_ONLOAD_JS_FUNCTION) { throw new InvalidConfigurationException('Property "error-callback" ("data-error-callback") must be different from "' . ReCaptchaBuilder::DEFAULT_ONLOAD_JS_FUNCTION . '"'); } return $tag_attributes; } /** * @return string */ public function getOnLoadCallback(): string { $attributes = $this->getTagAttributes(); return ""; } /** * Compare given attributes with allowed attributes * * @param array|null $attributes * @return array */ public static function cleanAttributes(?array $attributes = []): array { return array_filter($attributes, function ($k) { return in_array($k, self::$allowed_data_attribute); }, ARRAY_FILTER_USE_KEY); } }