Skip to content

Commit

Permalink
MDL-64075 antivirus_clamav: fix array_search usage
Browse files Browse the repository at this point in the history
If 'unix' is the first element of the stream_get_transports() result
array, array_search() will return `0` as index result which, when
negated, will result as true.
  • Loading branch information
OdyX committed Jan 7, 2020
1 parent c554024 commit 0acf1ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/antivirus/clamav/adminlib.php
Expand Up @@ -57,7 +57,7 @@ public function write_setting($data) {
public function validate($data) {
if ($data === 'unixsocket') {
$supportedtransports = stream_get_transports();
if (!array_search('unix', $supportedtransports)) {
if (array_search('unix', $supportedtransports) === false) {
return get_string('errornounixsocketssupported', 'antivirus_clamav');
}
}
Expand Down

0 comments on commit 0acf1ba

Please sign in to comment.