Skip to content

Commit

Permalink
Do not load google's recaptcha js asset if recaptcha is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ignacionelson committed Aug 27, 2023
1 parent fc479b0 commit d40be9e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions includes/Classes/AssetsLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ private function loadDefaultAssets()
'respondjs' =>['url' => ASSETS_LIB_URL.'/respond.min.js', 'version' => '1.4.2', 'args' => ['condition' => 'lt IE 9']],
],
'footer' => [
'recaptcha2' =>['url' => 'https://www.google.com/recaptcha/api.js'],
'js_assets' =>['url' => ASSETS_JS_URL . '/assets.js', 'version' => $db_version],
'js_app' =>['url' => ASSETS_JS_URL . '/app.js', 'version' => $db_version],
]
];
]
];

if (recaptcha2_is_enabled()) {
$this->js_assets['footer']['recaptcha2'] = ['url' => 'https://www.google.com/recaptcha/api.js'];
}
}

private function addCustomFilesAssets()
Expand Down

0 comments on commit d40be9e

Please sign in to comment.