File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -866,6 +866,11 @@ public function isOriginAllowed(string $origin):bool
866866 $ originWithoutPort = URLUtils::canonicalUrl ($ origin , false );
867867 if (empty ($ originWithoutPort )) return false ;
868868 $ originWithoutPort = URLUtils::normalizeUrl ($ originWithoutPort );
869+ // defensive: no reproducible input reaches this with a null (canonicalUrl()'s
870+ // filter_var/parse_url guard rejects everything malformed first), but the underlying
871+ // Normalizer's mbParseUrl() can diverge from parse_url() and reset to an empty state -
872+ // a null here comparing against a null registered-side normalization would false-match.
873+ if (empty ($ originWithoutPort )) return false ;
869874
870875 $ originWithPort = URLUtils::canonicalUrl ($ origin );
871876 $ originWithPort = empty ($ originWithPort ) ? null : URLUtils::normalizeUrl ($ originWithPort );
@@ -882,6 +887,7 @@ public function isOriginAllowed(string $origin):bool
882887 $ canonical_allowed_origin = URLUtils::canonicalUrl ($ allowed_origin );
883888 if (empty ($ canonical_allowed_origin )) continue ;
884889 $ canonical_allowed_origin = URLUtils::normalizeUrl ($ canonical_allowed_origin );
890+ if (empty ($ canonical_allowed_origin )) continue ;
885891
886892 if ($ originWithoutPort === $ canonical_allowed_origin ) return true ;
887893 if ($ originWithPort !== null && $ originWithPort === $ canonical_allowed_origin ) return true ;
You can’t perform that action at this time.
0 commit comments