Skip to content

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

@arnaud-netinfluence

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 !

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