Avoid indexing into log line
commit428df3066fac74a7f2359dc27c889c65e87e4db3
authorfiwswe <53953985+fiwswe@users.noreply.github.com>
Wed, 1 Feb 2023 01:54:44 +0000 (1 02:54 +0100)
committerGitHub <noreply@github.com>
Wed, 1 Feb 2023 01:54:44 +0000 (1 02:54 +0100)
tree217332b00be7204f2ca37c0ce2298c299887bd2c
parent7e785b0c529b8a745add808cbd3035e9b721bb57
Avoid indexing into log line

Should fix #3868

A log file should be treated as untrusted input. Thus we can make no assumptions about its content. Assuming a line has at least 2 characters length is an assumption we can avoid by using `substr($line, 0, 2) === '  '` instead of `$line[0] === ' ' && $line[1] === ' '`. No need to separately check for empty or `null` either.
lib/plugins/logviewer/admin.php