Skip to content

Usage of %env(XXX)% var in the redirect:mobile:host parameter of mobile_detect.yaml disable the redirection. #36

Description

@arnaud-netinfluence

Version 7.0.0

Because the .env vars remain unknown at compilation time, the test
$this->validHost($config['redirect']['mobile']['host'])
made in src/DependencyInjection/MobileDetectExtension.php:32
is always false if the parameter contains a call to env().
Eventually, the redirection is always disabled, regardless of the 'is_enabled' parameter.

Example:

mobile_detect:
  redirect:
    desktop:
      host: '%env(DESKTOP_HOST)%'

Maybe remove this check for the validity of the url at compilation time ? Or mention this limitation in the doc ?
Thx for maintaining this project !

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions