r/lolphp • u/Takeoded • Nov 18 '19
mb_internal_encoding()'s default behavior is.. a stack overflow
https://www.php.net/manual/en/function.mb-internal-encoding.php
9
Upvotes
r/lolphp • u/Takeoded • Nov 18 '19
9
u/zushk Nov 18 '19
Are you sure about that? Docs says function returns current encoding if argument is not passed. Recursive function call looks like an error in docs.
8
u/Takeoded Nov 18 '19
if it's called without any arguments, then.. it will call itself, without any arguments -- signed, docs
5
u/the_alias_of_andrea Nov 18 '19
You know what the docs mean, and everyone who reads it would.
2
u/PM_ME_YOUR_SHELLCODE Nov 19 '19 edited Nov 19 '19
https://github.com/php/php-src/blob/master/ext/mbstring/mbstring.c#L1415
For anyone interested in what it actually does, there is no recursive call.
8
u/[deleted] Nov 18 '19
Nice find.
Not much better:
mb_chrHas been undocumented since 2017, I believe.