Assignment operator (=) instead of equal comparison operator (==)

Created on 5 February 2025, 26 days ago

Problem/Motivation

In the DuplicateFinder::findDuplicates($file) method, there is a code for checking exact duplicates:

if ($file_hash = $duplicate_file_hash) {
  $duplicates['exact'][] = $row;
  $exact_duplicate = TRUE;
}

instead of

if ($file_hash === $duplicate_file_hash) {
  $duplicates['exact'][] = $row;
  $exact_duplicate = TRUE;
}

Steps to reproduce

Run duplicate finder and you will get 'exact' duplicates even if some of the listed duplicates aren't exact (don't have the same md5 hash).

Proposed resolution

use === instead of =

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇭🇺Hungary szato

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024