// Reverse the labels in the hostname, convert to lower case
// For emails reverse domainpart only
if ( $prot == 'mailto:' && strpos( $host, '@' ) ) {
- // complete email adress
+ // complete email address
$mailparts = explode( '@', $host );
$domainpart = strtolower( implode( '.', array_reverse( explode( '.', $mailparts[1] ) ) ) );
$host = $domainpart . '@' . $mailparts[0];
$like = array( "$prot$host", $db->anyString() );
} elseif ( $prot == 'mailto:' ) {
- // domainpart of email adress only. do not add '.'
+ // domainpart of email address only. do not add '.'
$host = strtolower( implode( '.', array_reverse( explode( '.', $host ) ) ) );
$like = array( "$prot$host", $db->anyString() );
} else {
* @return array filtered array
*/
public static function keepOneWildcard( $arr ) {
- if( !is_array( $arr ) ) {
+ if ( !is_array( $arr ) ) {
return $arr;
}
- foreach( $arr as $key => $value ) {
+ foreach ( $arr as $key => $value ) {
if ( $value instanceof LikeMatch ) {
return array_slice( $arr, 0, $key + 1 );
}