mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-08-13 00:35:27 -04:00
address Scrutinizer reported issues
This commit is contained in:
parent
cbc0d99c59
commit
70842cf271
6 changed files with 45 additions and 47 deletions
|
@ -69,10 +69,7 @@ class Filesystem extends AbstractData
|
|||
public function __construct(array $options)
|
||||
{
|
||||
// if given update the data directory
|
||||
if (
|
||||
is_array($options) &&
|
||||
array_key_exists('dir', $options)
|
||||
) {
|
||||
if (array_key_exists('dir', $options)) {
|
||||
$this->_path = $options['dir'];
|
||||
}
|
||||
}
|
||||
|
@ -315,7 +312,7 @@ class Filesystem extends AbstractData
|
|||
$file = $this->_path . DIRECTORY_SEPARATOR . 'salt.php';
|
||||
if (is_readable($file)) {
|
||||
$items = explode('|', file_get_contents($file));
|
||||
if (is_array($items) && count($items) == 3) {
|
||||
if (count($items) == 3) {
|
||||
return $items[1];
|
||||
}
|
||||
}
|
||||
|
@ -505,7 +502,7 @@ class Filesystem extends AbstractData
|
|||
if ($fileCreated === false || $writtenBytes === false || $writtenBytes < strlen($data)) {
|
||||
return false;
|
||||
}
|
||||
@chmod($filename, 0640); // protect file from access by other users on the host
|
||||
chmod($filename, 0640); // protect file from access by other users on the host
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue