Code Duplication    Length = 11-11 lines in 2 locations

main/inc/lib/CourseChatUtils.php 2 locations

@@ 1472-1482 (lines=11) @@
1469
        $date = date('Y-m-d');
1470
        $base = 'messages-' . $date . '.log.html';
1471
1472
        if ($this->groupId && !$friendId) {
1473
            $base = 'messages-' . $date . '_gid-' . $this->groupId . '.log.html';
1474
        } elseif ($this->sessionId && !$friendId) {
1475
            $base = 'messages-' . $date . '_sid-' . $this->sessionId . '.log.html';
1476
        } elseif ($friendId) {
1477
            if ($this->userId < $friendId) {
1478
                $base = 'messages-' . $date . '_uid-' . $this->userId . '-' . $friendId . '.log.html';
1479
            } else {
1480
                $base = 'messages-' . $date . '_uid-' . $friendId . '-' . $this->userId . '.log.html';
1481
            }
1482
        }
1483
1484
        if (!$absolute) {
1485
            return $base;
@@ 1549-1559 (lines=11) @@
1546
1547
        $filename_chat = 'messages-' . $date_now . '.log.html';
1548
1549
        if ($this->groupId && !$friendId) {
1550
            $filename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId . '.log.html';
1551
        } else if ($this->sessionId && !$friendId) {
1552
            $filename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId . '.log.html';
1553
        } elseif ($friendId) {
1554
            if ($this->userId < $friendId) {
1555
                $filename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId . '.log.html';
1556
            } else {
1557
                $filename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId . '.log.html';
1558
            }
1559
        }
1560
1561
        if (!file_exists($chat_path . $filename_chat)) {
1562
            @fclose(fopen($chat_path . $filename_chat, 'w'));