1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 22:11:12 +02:00
This commit is contained in:
Andrei Zmievski
2000-11-06 19:41:30 +00:00
parent cde5c779dc
commit 65f37060db

View File

@@ -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;
}