Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pôle IS
Bundles Symfony 2
file-upload-bundle
Commits
9a3815cc
Commit
9a3815cc
authored
Oct 20, 2017
by
Predhumeau Manon
Committed by
Guillaume Perréal
Jul 24, 2018
Browse files
Corrections in virusListener code
parent
66966364
Changes
1
Hide whitespace changes
Inline
Side-by-side
Listener/VirusScannerListener.php
View file @
9a3815cc
...
...
@@ -33,15 +33,16 @@ class VirusScannerListener
/**
* @param FileUploadCompleteEvent $event
* @throws ConnectionException
*/
public
function
onFileUploadCompleted
(
FileUploadCompleteEvent
$event
)
{
$
this
->
client
=
$this
->
getClient
();
$client
=
$this
->
getClient
();
$file
=
$event
->
getUploadedFile
();
$path
=
$file
->
getLocalPath
();
$result
=
$
this
->
client
->
scanFile
(
$path
);
$result
=
$client
->
scanFile
(
$path
);
$hasVirus
=
$result
[
'status'
]
===
Client
::
RESULT_FOUND
;
$meta
=
$file
->
getMetadata
();
...
...
@@ -65,13 +66,8 @@ class VirusScannerListener
*/
private
function
getClient
():
Client
{
try
{
// Check clamd server's state
$this
->
client
->
ping
();
return
$this
->
client
;
}
catch
(
ConnectionException
$connectionException
)
{
throw
$connectionException
;
}
// Check clamd server's state
$this
->
client
->
ping
();
return
$this
->
client
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment