BBCodeEmailAddressValidator::check_domain_portion( $strDomainPortion )
Description
Source
File: bp-forums/admin/parser.php
1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 | function check_domain_portion( $strDomainPortion ) { if (! $this ->check_text_length( $strDomainPortion , 1, 255)) { return false; } if (preg_match( '/^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])' . '(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}$/' , $strDomainPortion ) || preg_match( '/^\[(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])' . '(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}\]$/' , $strDomainPortion )) { return true; } else { $arrDomainPortion = explode ( '.' , $strDomainPortion ); if (sizeof( $arrDomainPortion ) < 2) { return false; } for ( $i = 0, $max = sizeof( $arrDomainPortion ); $i < $max ; $i ++) { if (! $this ->check_text_length( $arrDomainPortion [ $i ], 1, 63)) { return false; } if (!preg_match( '/^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|' . '([A-Za-z0-9]+))$/' , $arrDomainPortion [ $i ])) { return false; } } } return true; } |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.