Skip to content
Snippets Groups Projects
Commit b91d3024 authored by Kay Stenschke's avatar Kay Stenschke Committed by Demian Katz
Browse files

Check if file exists before deleting in destroy()

Added file_exists check before deleting session file in destroy() of VuFind/Session/File.php to prevent Warning: unlink(): No such file or directory
parent de3c75e9
No related merge requests found
...@@ -140,7 +140,10 @@ class File extends AbstractBase ...@@ -140,7 +140,10 @@ class File extends AbstractBase
// Perform file-specific cleanup: // Perform file-specific cleanup:
$sess_file = $this->getPath() . '/sess_' . $sess_id; $sess_file = $this->getPath() . '/sess_' . $sess_id;
return(unlink($sess_file)); if (file_exists($sess_file)) {
return(unlink($sess_file));
}
return true;
} }
/** /**
...@@ -160,4 +163,4 @@ class File extends AbstractBase ...@@ -160,4 +163,4 @@ class File extends AbstractBase
} }
return true; return true;
} }
} }
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment