• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_unqualified_hostname函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_unqualified_hostname函数的典型用法代码示例。如果您正苦于以下问题:PHP is_unqualified_hostname函数的具体用法?PHP is_unqualified_hostname怎么用?PHP is_unqualified_hostname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_unqualified_hostname函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: do_input_validation

 do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
 /* either MAC or Client-ID must be specified */
 if (empty($_POST['mac']) && empty($_POST['cid'])) {
     $input_errors[] = gettext("Either MAC address or Client identifier must be specified");
 }
 /* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
 $_POST['mac'] = strtolower(str_replace("-", ":", $_POST['mac']));
 if ($_POST['hostname']) {
     preg_match("/\\-\$/", $_POST['hostname'], $matches);
     if ($matches) {
         $input_errors[] = gettext("The hostname cannot end with a hyphen according to RFC952");
     }
     if (!is_hostname($_POST['hostname'])) {
         $input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'.");
     } else {
         if (!is_unqualified_hostname($_POST['hostname'])) {
             $input_errors[] = gettext("A valid hostname is specified, but the domain name part should be omitted");
         }
     }
 }
 if ($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr'])) {
     $input_errors[] = gettext("A valid IP address must be specified.");
 }
 if ($_POST['mac'] && !is_macaddr($_POST['mac'])) {
     $input_errors[] = gettext("A valid MAC address must be specified.");
 }
 if ($static_arp_enabled && !$_POST['ipaddr']) {
     $input_errors[] = gettext("Static ARP is enabled.  You must specify an IP address.");
 }
 /* check for overlaps */
 foreach ($a_maps as $mapent) {
开发者ID:sjourdois,项目名称:pfsense,代码行数:31,代码来源:services_dhcp_edit.php


示例2: foreach

     }
     if (ctype_digit($entry)) {
         $aliases[$entry][$field] = $value;
     }
 }
 $pconfig['aliases']['item'] = $aliases;
 /* validate aliases */
 foreach ($aliases as $idx => $alias) {
     $aliasreqdfields = array('aliasdomain' . $idx);
     $aliasreqdfieldsn = array(gettext("Alias Domain"));
     do_input_validation($_POST, $aliasreqdfields, $aliasreqdfieldsn, $input_errors);
     if ($alias['host']) {
         if (!is_hostname($alias['host'])) {
             $input_errors[] = gettext("Hostnames in an alias list can only contain the characters A-Z, 0-9 and '-'. They may not start or end with '-'.");
         } else {
             if (!is_unqualified_hostname($alias['host'])) {
                 $input_errors[] = gettext("A valid alias hostname is specified, but the domain name part should be omitted");
             }
         }
     }
     if ($alias['domain'] && !is_domain($alias['domain'])) {
         $input_errors[] = gettext("A valid domain must be specified in alias list.");
     }
 }
 /* check for overlaps */
 foreach ($a_hosts as $hostent) {
     if (isset($id) && $a_hosts[$id] && $a_hosts[$id] === $hostent) {
         continue;
     }
     if ($hostent['host'] == $_POST['host'] && $hostent['domain'] == $_POST['domain'] && (is_ipaddrv4($hostent['ip']) && is_ipaddrv4($_POST['ip']) || is_ipaddrv6($hostent['ip']) && is_ipaddrv6($_POST['ip']))) {
         $input_errors[] = gettext("This host/domain already exists.");
开发者ID:nmccurdy,项目名称:pfsense,代码行数:31,代码来源:services_unbound_host_edit.php



注:本文中的is_unqualified_hostname函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_upload_space_available函数代码示例发布时间:2022-05-15
下一篇:
PHP is_uninstallable_plugin函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap