[php-src] Issue #10612: substr_count crashes on EDGE is $neelde is empty.
| From: | marcelscholte | Date: | Fri, 17 Feb 2023 16:29:01 +0000 |
| Subject: | [php-src] Issue #10612: substr_count crashes on EDGE is $neelde is empty. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-243745@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/10612
Author: marcelscholte
### Description
The following code:
if(substr_count($object['hsum_timestamps'],$session['hsum_access'])==0){
...
}else{
...
}
Resulted in this output:
500 error in Edge browser, works fine in chrome
Workaround:
if(empty($session['hsum_acess']) ||
substr_count($object['hsum_timestamps'],$session['hsum_acess'])==0){
Maybe change substr_count settings that if Sneelde is empty result is 0.
substr_count(
string $haystack,
string $needle,
int $offset = 0,
?int $length = null,
init $value_on_error =0
): int
if error in count output $value_on_error
### PHP Version
PHP 8
### Operating System
_No response_