Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of TYPO3 trustedHostsPattern warning, fixes #1739 #1741

Merged
merged 4 commits into from
Jul 29, 2019
Merged

Get rid of TYPO3 trustedHostsPattern warning, fixes #1739 #1741

merged 4 commits into from
Jul 29, 2019

Commits on Jul 29, 2019

  1. Get rid of TYPO3 trustedHostsPattern warning, fixes #1739

    This sets trustedHostsPattern to all configured hosts + "localhost" and "127.0.0.1".
    jonaseberle authored Jul 29, 2019
    Configuration menu
    Copy the full SHA
    2b63a9d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    681f9d4 View commit details
    Browse the repository at this point in the history
  3. Cater for PHPs HTTP_HOST possibly containing port numbers

    Port numbers are appended to HTTP_HOST if they are non-standard.
    They could theoretically be extracted from app.GetAllURLs() but I am not sure if it would be enough to just strip `http://`/ `https://` from these values or if they might also be followed by a path.
    This takes a shortcut and does not whitelist the actual ports but rather allows ALL ports. I guess this is reasonable to keep the code simple.
    jonaseberle authored Jul 29, 2019
    Configuration menu
    Copy the full SHA
    fce188a View commit details
    Browse the repository at this point in the history
  4. Use consistent backslash escaping in regular expression; Use GetDocke…

    …rIP() to get host's interface IP
    
    The output containing the backslashed looks like that:
    
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = 't3-master.ddev.site(:\\d+)?|localhost(:\\d+)?|127.0.0.1(:\\d+)?';
    jonaseberle authored Jul 29, 2019
    Configuration menu
    Copy the full SHA
    69596e4 View commit details
    Browse the repository at this point in the history