1
0
Fork 0

Ensure stripos() receives a string

If file_get_contents() returns false, stripos() will throw a TypeError.
Casting to string prevents this from happening.

Closes #11470
pull/11475/head
Jørn Støylen 2023-05-20 11:30:39 +02:00 committed by Jordi Boggiano
parent e51d755a08
commit 9885d23e2a
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 1 additions and 1 deletions

View File

@ -148,7 +148,7 @@ class Platform
if (
!ini_get('open_basedir')
&& is_readable('/proc/version')
&& false !== stripos(Silencer::call('file_get_contents', '/proc/version'), 'microsoft')
&& false !== stripos((string)Silencer::call('file_get_contents', '/proc/version'), 'microsoft')
&& !file_exists('/.dockerenv') // docker running inside WSL should not be seen as WSL
) {
return self::$isWindowsSubsystemForLinux = true;