Method setupCookieConsent seems inefficient


Well-known member
Affected version
Method \XF\App::setupCookieConsent() is called whenever cookie consent is being used, for example when displaying an embedded media.

This method does quite some work:
  • Instantiates a CAPTCHA
  • Loops through all media sites
  • Loops through active payment providers
This seems pointless if cookie consent is disabled - in this case it doesn't matter which 3rd parties are active so all this work could be avoided entirely (unless information about all 3rd parties is required, like when viewing the cookie info page).

In case cookie consent is active some kind of cache should be used so this information doesn't have to be fully generated at runtime.
Top Bottom