cms icon indicating copy to clipboard operation
cms copied to clipboard

Site base URL prefixed with "http://" if set to an environment variable not currently in .env

Open mmikkel opened this issue 5 years ago • 1 comments

Description

If a site's "Base URL" setting is set to an environment variable (i.e. any value starting with a $) that doesn't actually have a corresponding key in .env, upon saving the site Craft prefixes the value with "http://", which feels like a bug.

image

Steps to reproduce

  1. Set the "Base URL" setting to a non-existent environment variable (e.g. $FOOBAR)
  2. Save the site
  3. Confirm that Craft has prefixed the environment variable with "http://"

Additional info

  • Craft version: 3.5.0-RC6
  • PHP version:
  • Database driver & version:
  • Plugins & versions:

mmikkel avatar Aug 03 '20 18:08 mmikkel

We’ll have to think about the best way to address this. Part of me is thinking we should just stop validating any values that are set to an environment variable altogether.

brandonkelly avatar Aug 03 '20 20:08 brandonkelly