Skip to content

Commit 99442a3

Browse files
committed
small correction to substr
1 parent 6b067db commit 99442a3

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
@@ -2239,7 +2239,7 @@ PHP_FUNCTION(substr)
22392239
f = 0;
22402240
}
22412241

2242-
if (l < 0 && ((f > 0 && (l + str_len) < f) || (f < 0 && (l+str_len) > f))) {
2242+
if (l < 0 && ((f > 0 && (l + str_len) < f) || (f < 0 && (l+str_len) > -f))) {
22432243
RETURN_FALSE;
22442244
}
22452245

0 commit comments

Comments
 (0)