7.2.X, 7.3.X, Master
When saving an entry to the VirtualHost table by giving a LayoutSet virtual hostname, capitalization is saved in the DB, which is incorrect. Hostnames should be lowercase. This results in missed fetches, since the portal always fetches lowercase, but the entries are saved with capitalization.
Steps to reproduce:
- Modify hosts file to include at least two new hosts, "liferay-lower" and "LIFERAY-UPPER"
- Create two new sites with a public widget page on each.
- For each site, go to Configuration > Site Settings > Site Configuration > Site URL
- For one site, change the "Virtual Host" value to "liferay-lower". The other site, use "LIFERAY-UPPER".
- In a new tab, visit http://liferay-lower:8080 or http://LIFERAY-LOWER:8080 (capitalization should not matter in URLs)
- Verify you are taken directly to the site's default public page as specified in step 4.
- In a new tab, visit http://liferay-upper:8080 or http://LIFERAY-UPPER:8080.
Expected Results: Portal redirects to site created in step 4
Actual Results: Portal redirects to default site and page, like when using localhost
Bonus bug: The same virtual hostname can be used in multiple layoutsets or virtual instances as long as the capitalization is different. This goes against our unique hostname constraint, at least in the functional aspect.
Reproduced in master: 62f3e2f73e7ac48f81c19bc25e9396abc1004044