'==' and '!=' are discouraged
This commit is contained in:
parent
e5eb15cbc5
commit
86fb4ead72
@ -80,7 +80,7 @@ abstract class Db {
|
||||
$data = $result->fetchAll();
|
||||
if (!is_array($data) || !count($data)){
|
||||
$this->data = array();
|
||||
} elseif (count($data)!=1) {
|
||||
} elseif (count($data) !== 1) {
|
||||
throw new Exception('Duplicate ' . $value . ' for the filed ' . $field);
|
||||
} else {
|
||||
$this->data = $data[0];
|
||||
|
@ -61,7 +61,7 @@ class Wopi extends \OCA\Richdocuments\Db{
|
||||
$wopi = new Wopi();
|
||||
$row = $wopi->loadBy('token', $token)->getData();
|
||||
\OC::$server->getLogger()->debug('Loaded WOPI Token record: {row}.', [ 'row' => $row ]);
|
||||
if (count($row) == 0)
|
||||
if (count($row) === 0)
|
||||
{
|
||||
// Invalid token.
|
||||
http_response_code(401);
|
||||
@ -75,7 +75,7 @@ class Wopi extends \OCA\Richdocuments\Db{
|
||||
//$wopi->deleteBy('id', $row['id']);
|
||||
//return false;
|
||||
}
|
||||
if ($row['fileid'] != $fileId || $row['version'] != $version){
|
||||
if ($row['fileid'] !== $fileId || $row['version'] !== $version){
|
||||
// File unknown / user unauthorized (for the requested file).
|
||||
http_response_code(404);
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user