Joomla check for empty string with JInput

别等时光非礼了梦想. 提交于 2019-12-05 19:27:01

It's not up to Joomla to decide whether your empty string is valid value or not. They have to use isset(), because if they would use empty() and you return '0' which you would expect as normal, Joomla would return default value instead of that '0'.

So it's completely normal that they just use isset() to check if variable is set, and it's up to you to decide what values you accept.

If the value isn't set, and you set as the second parameter empty string '', you'll get an empty string returned.

In your example an empty string would be returned, which is expected behaviour.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!