-
Notifications
You must be signed in to change notification settings - Fork 35
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
Fix config.php array error #300
Conversation
b9c05b3
to
53c54ab
Compare
|
||
// Depending on the Ngrok version its hostname is stored in different server vars | ||
$ngrok_server_vars = array( | ||
$_SERVER['HTTP_X_FORWARDED_HOST'] ?: '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the easiest fix is just to change ?:
to ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??
works for me, no additional changes needed.
Personally I prefer the array over the regex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??
doesn't work in PHP 5.3 is the thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, forgot about this dinosaur ;)
|
||
// Depending on the Ngrok version its hostname is stored in different server vars | ||
$ngrok_server_vars = array( | ||
$_SERVER['HTTP_X_FORWARDED_HOST'] ?: '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, forgot about this dinosaur ;)
Was getting the following error with the example config.php syntax in PHP 8.3 - I thought I had tested it but I think mutagen wasn't syncing properly, so I was testing against an older config.php without realising
Couldn't get the
foreach
loop to make sense with the?:
notation, so I've just set it back to usingif
statements. I've verified that this setup works with PHP 5.3 and 8.3, and that ngrok still works.