Fix domain validation checking wrong variable in functions domain loop#11676
Fix domain validation checking wrong variable in functions domain loop#11676zaidxshaikh wants to merge 1 commit intoappwrite:1.9.xfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change fixes a variable reference bug in the validateDomainRestrictions() method in src/Appwrite/Platform/Modules/Proxy/Action.php. The foreach loop over values from the _APP_DOMAIN_FUNCTIONS environment variable previously checked the outer variable $functionsDomains in its empty() condition instead of the loop variable $functionsDomain; the condition now correctly checks $functionsDomain so empty entries are skipped as intended, matching the pattern used for sites domains. Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR fixes a one-character variable name typo in
Confidence Score: 5/5Safe to merge — minimal, correct one-token fix with no logic regressions. The change is a single variable-name correction that directly parallels the already-correct pattern used for the sites domain loop. No new logic is introduced, and no other issues were found in the file. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "Fix domain validation checking wrong var..." | Re-trigger Greptile |
The empty() check inside the forEach loop was checking the outer $functionsDomains variable instead of the loop variable $functionsDomain, causing empty entries to never be skipped when the env var is set. Fixes appwrite#11675
90b2563 to
3bb2c34
Compare
Summary
src/Appwrite/Platform/Modules/Proxy/Action.phpwhere theempty()check inside theforeachloop was checking the outer variable$functionsDomainsinstead of the loop variable$functionsDomain$sitesDomain, but the functions domain loop (line 53) was incorrectly checking$functionsDomainsImpact
When
_APP_DOMAIN_FUNCTIONSenv var is set, empty entries from trailing/double commas are never skipped and get processed as invalid domain restrictions.Fixes #11675