Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Commit 707e6be

Browse files
committed
Sort attributes in htmlFormSnippet method
1 parent 5861d8f commit 707e6be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ReCaptchaBuilderV2.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function htmlFormSnippet(?array $attributes = []): string
5454

5555
$data_attributes = [];
5656
$config_data_attributes = array_merge($this->getTagAttributes(), self::cleanAttributes($attributes));
57-
57+
ksort($config_data_attributes);
5858
foreach ($config_data_attributes as $k => $v) {
5959
if ($v) {
6060
$data_attributes[] = 'data-' . $k . '="' . $v . '"';
@@ -111,7 +111,7 @@ public function getOnLoadCallback(): string
111111
* @param array|null $attributes
112112
* @return array
113113
*/
114-
protected static function cleanAttributes(?array $attributes = []): array
114+
public static function cleanAttributes(?array $attributes = []): array
115115
{
116116
return array_filter($attributes, function ($k) {
117117
return in_array($k, self::$allowed_data_attribute);

0 commit comments

Comments
 (0)