- keywords 3.2-early added
Cool. (Not a problem, also. I killed the attachment.)
Patch looks great, at a glance. All I see are coding standards improvements to be addressed. Marking for 3.2-early.
- foreach ( and if ( rather than foreach( and if(. Same goes for opening braces, space before.
- substr( $limited_domain, 0, 2 ) == '*.' should probably be 0 === strpos( $limited_domain, '*.' ).
- The direct domain match can be made into an elseif, instead of the nested if.
- Once a match is found, you should break; out of the foreach; no need to keep checking.
- No need for the braces around the one-line if at the bottom.
- $matched_domain == false should be ! $matched_domain.