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

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