mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
return false instead of empty string when -length is greater than (len - offset)
This commit is contained in:
parent
c829314963
commit
81f99c721b
@ -2077,6 +2077,10 @@ PHP_FUNCTION(substr)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (l < 0 && (l + Z_STRLEN_PP(str) - f) < 0) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* if "from" position is negative, count start position from the end
|
||||
* of the string
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user