Cleanup: dead code and minor correctness issues found during security audit #17
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: cleanup / minor correctness. Found by security audit run 3 (commit
01195c8). None of these cross a security boundary.HostResolver::isPrimary()(src/Request/HostResolver.php:41-44) checks theisPrimaryflag rather than identity withSettings::primary(). With a stored config that has no flagged primary (not reachable through the sanitizer),redirect_canonicalis suppressed on every host. Compare againstSettings::primary()instead.UrlRewriter::urlFor()(src/Rewrite/UrlRewriter.php:70-77) is unused and shares the request-scheme behaviour from #9. Remove it or fix it together withrewrite().Host::scheme()(src/Config/Host.php:27-29) returns https for clearnet hosts but is never called; either use it (see #9) or delete it so the intent is not implied.get_avatar_urlis hooked twice: once viaURL_FILTERS(src/Rewrite/HookBindings.php:38) and again explicitly (src/Rewrite/HookBindings.php:61). Harmless (idempotent) but redundant.uninstall.php:22callsget_sites( array( 'fields' => 'ids' ) )with the default limit of 100, so on larger networksmulti_domain_redux_settingsis left on blogs after the 100th. Pass'number' => 0or paginate.