开发者

Zend Framework: validation of hostname

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜