mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-07-17 02:22:52 -04:00
Fix some PHPstan errors (#4019)
Fix some wrong variables found by https://github.com/FreshRSS/FreshRSS/issues/4016
This commit is contained in:
committed by
GitHub
parent
a2ab9cf83a
commit
00dbde68fb
@@ -460,7 +460,7 @@ SQL;
|
||||
. 'SET `cache_nbUnreads`=`cache_nbUnreads`-' . $affected
|
||||
. ' WHERE id=:id';
|
||||
$stm = $this->pdo->prepare($sql);
|
||||
$stm->bindParam(':id', $id_feed, PDO::PARAM_INT);
|
||||
$stm->bindParam(':id', $id, PDO::PARAM_INT);
|
||||
if (!($stm && $stm->execute())) {
|
||||
$info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
||||
Minz_Log::error('SQL error keepMaxUnread cache: ' . json_encode($info));
|
||||
|
||||
@@ -55,7 +55,7 @@ class FreshRSS_Tag extends Minz_Model {
|
||||
$tagDAO = FreshRSS_Factory::createTagDao();
|
||||
$this->nbEntries = $tagDAO->countEntries($this->id());
|
||||
}
|
||||
return $this->nbFeed;
|
||||
return $this->nbEntries;
|
||||
}
|
||||
|
||||
public function _nbEntries($value) {
|
||||
|
||||
@@ -14,7 +14,7 @@ class FreshRSS_UserDAO extends Minz_ModelPdo {
|
||||
if ($ok) {
|
||||
return true;
|
||||
} else {
|
||||
$info = empty($stm) ? $this->pdo->errorInfo() : $stm->errorInfo();
|
||||
$info = $this->pdo->errorInfo();
|
||||
Minz_Log::error(__METHOD__ . ' error: ' . json_encode($info));
|
||||
return false;
|
||||
}
|
||||
@@ -31,8 +31,8 @@ class FreshRSS_UserDAO extends Minz_ModelPdo {
|
||||
if ($ok) {
|
||||
return true;
|
||||
} else {
|
||||
$info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
||||
Minz_Log::error(__METHOD__ . ' error: ' . $info[2]);
|
||||
$info = $this->pdo->errorInfo();
|
||||
Minz_Log::error(__METHOD__ . ' error: ' . json_encode($info));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ function is_valid_path_extension($path, $extensionPath, $isStatic = true) {
|
||||
*/
|
||||
function is_valid_path($path) {
|
||||
return is_valid_path_extension($path, CORE_EXTENSIONS_PATH) || is_valid_path_extension($path, THIRDPARTY_EXTENSIONS_PATH)
|
||||
|| is_valid_path_extension($path, USERS_PATH, $false);
|
||||
|| is_valid_path_extension($path, USERS_PATH, false);
|
||||
}
|
||||
|
||||
function sendBadRequestResponse(string $message = null) {
|
||||
|
||||
Reference in New Issue
Block a user