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

Created on 3 Aug 2020  路  1Comment  路  Source: craftcms/cms

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:
bug minor

Most helpful comment

We鈥檒l 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.

>All comments

We鈥檒l 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brandonkelly picture brandonkelly  路  3Comments

timkelty picture timkelty  路  3Comments

bitboxfw picture bitboxfw  路  3Comments

leigeber picture leigeber  路  3Comments

darylknight picture darylknight  路  3Comments