mirror of
https://github.com/php/php-src.git
synced 2026-04-19 22:11:12 +02:00
Fix bug #7667.
This commit is contained in:
@@ -1270,7 +1270,9 @@ PHP_FUNCTION(substr_replace)
|
||||
if (f < 0) {
|
||||
f = 0;
|
||||
}
|
||||
}
|
||||
} else if (f > (int)(*str)->value.str.len)
|
||||
f = (int)(*str)->value.str.len;
|
||||
|
||||
|
||||
/* if "length" position is negative, set it to the length
|
||||
* needed to stop that many chars from the end of the string
|
||||
@@ -1282,10 +1284,6 @@ PHP_FUNCTION(substr_replace)
|
||||
}
|
||||
}
|
||||
|
||||
if (f >= (int)(*str)->value.str.len) {
|
||||
RETURN_STRINGL((*str)->value.str.val, (*str)->value.str.len, 1);
|
||||
}
|
||||
|
||||
if((f+l) > (int)(*str)->value.str.len) {
|
||||
l = (int)(*str)->value.str.len - f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user