[TYPO3-core] RFC: #9575: use native filter_functions for validate and sanitize
Martin Kutschker
masi-no at spam-typo3.org
Fri Oct 24 16:11:25 CEST 2008
Steffen Kamper schrieb:
> Hi,
>
> there is a different behaviour to the prior state.
>
> As the function eg validEmail before returns false/true,
> the php filter-functions return false/input string (which is that was
> the name says, it filters .-))
>
> Most users won't discover, as 98% are testing validEmail with
> if (!t3lib_div::validEmail($email)) { ... }
>
> So 2 possibilities:
> 1) leave it as it is and change the phpdoc for return var
> 2) change return var to boolean
>
> i would vote for 1) but i see compatibility too with 2)
2) as our funcion isn't a filter.
return filter_var($ip, FILTER_VALIDATE_IP)===false ? false : true;
Masi
More information about the TYPO3-team-core
mailing list