Add return types to html encoding functions (#8633)
Summary:
These functions have signatures like `String HHVM_FUNCTION(function_name_here, ...`.
So they always return strings.
https://github.com/facebook/hhvm/blob/master/hphp/runtime/ext/string/ext_string.cpp#L1698
https://github.com/facebook/hhvm/blob/master/hphp/runtime/ext/string/ext_string.cpp#L1708
https://github.com/facebook/hhvm/blob/master/hphp/runtime/ext/string/ext_string.cpp#L1720
https://github.com/facebook/hhvm/blob/master/hphp/runtime/ext/string/ext_string.cpp#L1727
If it wasn't for the TAny in the HHI I would have never gone to the PHP docs and read the following for htmlspecialchars:
`If the input string contains an invalid code unit sequence within the given encoding an empty string will be returned, unless either the ENT_IGNORE or ENT_SUBSTITUTE flags are set. `
I assumed false on failure since that is the PHP-way.
Pull Request resolved: https://github.com/facebook/hhvm/pull/8633
Reviewed By: DavidSnider
Differential Revision:
D20349451
fbshipit-source-id:
57affd3361d677343a4b50676b3fd1d8ffbcb768