Code Duplication    Length = 7-7 lines in 3 locations

lib/backend.php 1 location

@@ 437-443 (lines=7) @@
434
435
		$this->db->executeQuery("DELETE FROM *PREFIX*ownnote_parts WHERE id=?", Array($nid));
436
437
		if ($FOLDER != '') {
438
			$tmpfile = $FOLDER . "/" . $name . ".htm";
439
			if ($group != '')
440
				$tmpfile = $FOLDER . "/[" . $group . "] " . $name . ".htm";
441
			if (Filesystem::file_exists($tmpfile))
442
				Filesystem::unlink($tmpfile);
443
		}
444
		return true;
445
	}
446

lib/Service/OwnNoteService.php 2 locations

@@ 205-211 (lines=7) @@
202
		if ($note instanceof OwnNote) {
203
			$group = $note->getGrouping();
204
			$name = $note->getName();
205
			if ($FOLDER != '') {
206
				$tmpfile = $FOLDER . "/" . $name . ".htm";
207
				if ($group != '')
208
					$tmpfile = $FOLDER . "/[" . $group . "] " . $name . ".htm";
209
				if (Filesystem::file_exists($tmpfile))
210
					Filesystem::unlink($tmpfile);
211
			}
212
			$this->noteMapper->deleteNote($note);
213
			return true;
214
		} else {
@@ 226-232 (lines=7) @@
223
	public function removeFile($FOLDER, $note){
224
		$group = $note->getGrouping();
225
		$name = $note->getName();
226
		if ($FOLDER != '') {
227
			$tmpfile = $FOLDER . "/" . $name . ".htm";
228
			if ($group != '')
229
				$tmpfile = $FOLDER . "/[" . $group . "] " . $name . ".htm";
230
			if (Filesystem::file_exists($tmpfile))
231
				Filesystem::unlink($tmpfile);
232
		}
233
	}
234
235
	/**