File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -4129,7 +4129,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines)
4129
4129
4130
4130
while (1 ) {
4131
4131
char_count = 0 ;
4132
- while ((!max_chars || char_count < max_chars ) && begin > 0 ) {
4132
+ while ((!max_chars || max_chars > 0 && char_count < max_chars ) && begin > 0 ) {
4133
4133
char_count ++ ;
4134
4134
begin -- ;
4135
4135
if (begin <= 0 || _isnewline (heb_str [begin ])) {
@@ -4140,7 +4140,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines)
4140
4140
break ;
4141
4141
}
4142
4142
}
4143
- if (char_count == max_chars ) { /* try to avoid breaking words */
4143
+ if (max_chars >= 0 && char_count == max_chars ) { /* try to avoid breaking words */
4144
4144
zend_str_size_int new_char_count = char_count , new_begin = begin ;
4145
4145
4146
4146
while (new_char_count > 0 ) {
You can’t perform that action at this time.
0 commit comments