Eg when installing Piwik via
mydomain:8000, Piwik will probably save
trusted_hosts = mydomain:8000. As soon as the installation is finished, Piwik will not allow you to log in as the URL does not match. Piwik recommends to set
trusted_hosts = mydomain in the UI.
I'm not sure what exactly the error is. Either Piwik saves
trusted_hosts = mydomain:8000 and requires
trusted_hosts = mydomain or it is the other way around. Or the check whether a host matches doesn't correctly check for the port.
If you install Piwik via
mydomain:8000 and then try to open Piwik via
mydomain (without port, or with a different port), it is expected that Piwik will ask you to add
mydomain to trusted_host (The trusted host must include the same hostname and port.). Did you think this was a bug, or is there really a bug?
I think the description of this ticket is backwards. The problem is that if you install piwik on
mydomain:8000 the installation script adds
config/config.ini.php. So when you try to visit piwik at
mydomain:8000 piwik will complain loudly, until you manually edit
config/config.ini.php to include
mydomain:8000 as a trusted host.
So from what I can see, the problem is that the installation script only adds the domain, and not the port, to the
trusted_hosts array in the configuration. (Which is also the title of this ticket, i.e "When installing Piwik, the port is not correctly saved for trusted_hosts")