Skip to content

Commit e789663

Browse files
committed
Remove always-false condition from substr_replace()
l < 0 is checked before and set to a different value.
1 parent ea5521c commit e789663

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/standard/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2171,7 +2171,7 @@ PHP_FUNCTION(substr_replace)
21712171
}
21722172
}
21732173

2174-
if ((size_t)l > ZSTR_LEN(str) || (l < 0 && (size_t)(-l) > ZSTR_LEN(str))) {
2174+
if ((size_t)l > ZSTR_LEN(str)) {
21752175
l = ZSTR_LEN(str);
21762176
}
21772177

0 commit comments

Comments
 (0)