开发者

Zend Framework: validation of hostname

开发者 https://www.devze.com 2023-02-13 10:13 出处:网络
I would like to check a hostname. For exapmle: www.site.ru, site.ru, http://site.ru. These variants are correct. But: http://site.ru/ zf sets as 开发者_开发知识库not correct.

I would like to check a hostname. For exapmle: www.site.ru, site.ru, http://site.ru.

These variants are correct. But: http://site.ru/ zf sets as 开发者_开发知识库not correct.

How to check the hostname like shown above via hostname validator?


www.site.ru, site.ru are domains while http://www.site.ru is URI you need to manually strip the protocol/scheme part, by the way site.ru/folder/ is a correct URI but a correct hostname. I wrote a filter for Zend Framework, which allow you to prepend http:// to an hostname. Maybe that helps

0

精彩评论

暂无评论...
验证码 换一张
取 消