Skip to content

Conversation

@StephenWakely
Copy link
Contributor

If Origin Detection is configured to be off, we should not output the external env value.

@StephenWakely StephenWakely requested a review from a team as a code owner August 5, 2025 16:37
if ((isset($config["origin_detection"]) && !$config["origin_detection"])) {
return false;
if (isset($config["origin_detection"])) {
return $config["origin_detection"];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit rusty on PHP, but would that be worth doing a boolean test?

return $config["origin_detection"] == true;

or is this array access enough for what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is testing if the value is truthy, rather than strict true, so you could configure 'origin_detection' => 42 and it would be true. From my understanding it is more idiomatic PHP to accept truthy values rather than expect a strict true to be passed in this situation.

@StephenWakely StephenWakely merged commit f729ef0 into master Aug 6, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants