Re: validate_file() and strip_file()
| From: | Ilia Alshanetsky | Date: | Thu, 20 Nov 2003 14:21:25 +0000 |
| Subject: | Re: validate_file() and strip_file() | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-5616@lists.php.net to get a copy of this message | ||
On November 20, 2003 02:22 am, Andi Gutmans wrote:>
> Andi
>
> P.S.-If you think php_strip_whitespace() is misleading then see if you can
> find a better name. I think php_strip() is just too short and will be
> confused with strip() (which doesn't exist but still...)
> Looks much better now. Please make sure you test it well because it's quite
> sensitive APIs you are using.
Indeed, so far they pass all tests without crashes or leaks and valgrind gives
it an all clear, so I am pretty happy with it's operation at this point.
That said, if all the people who gave the functions a +1 would be willing to
try them just to see if they can make them break (hopefully fail ;) ) that
would be great.
> About the return value, I think it should return the error message or true
> on success. Then people could use === to check what they got (I prefer that
> over Markus' idea). Then again I'm not completely sure about it so it
> depends on what you think is the easiest.
Originally I thought the same thing, but comments by Markus Fischer (in this
thread) have convinced me that it would be clearer from user perspective to
return the error by reference. We still get quite a few bug reports about
functions that should be checked with === true/false, so I am a little weary
of adding another such function.
Ilia