Code Duplication    Length = 11-11 lines in 2 locations

main/inc/lib/CourseChatUtils.php 2 locations

@@ 1512-1522 (lines=11) @@
1509
1510
        $base = 'messages-' . $date . '.log.html';
1511
1512
        if ($this->groupId && !$friendId) {
1513
            $base = 'messages-' . $date . '_gid-' . $this->groupId . '.log.html';
1514
        } elseif ($this->sessionId && !$friendId) {
1515
            $base = 'messages-' . $date . '_sid-' . $this->sessionId . '.log.html';
1516
        } elseif ($friendId) {
1517
            if ($this->userId < $friendId) {
1518
                $base = 'messages-' . $date . '_uid-' . $this->userId . '-' . $friendId . '.log.html';
1519
            } else {
1520
                $base = 'messages-' . $date . '_uid-' . $friendId . '-' . $this->userId . '.log.html';
1521
            }
1522
        }
1523
1524
        if (!$absolute) {
1525
            return $base;
@@ 1589-1599 (lines=11) @@
1586
1587
        $filename_chat = 'messages-' . $date_now . '.log.html';
1588
1589
        if ($this->groupId && !$friendId) {
1590
            $filename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId . '.log.html';
1591
        } else if ($this->sessionId && !$friendId) {
1592
            $filename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId . '.log.html';
1593
        } elseif ($friendId) {
1594
            if ($this->userId < $friendId) {
1595
                $filename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId . '.log.html';
1596
            } else {
1597
                $filename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId . '.log.html';
1598
            }
1599
        }
1600
1601
        if (!file_exists($chat_path . $filename_chat)) {
1602
            @fclose(fopen($chat_path . $filename_chat, 'w'));