Code Duplication    Length = 11-11 lines in 2 locations

main/inc/lib/CourseChatUtils.php 2 locations

@@ 1492-1502 (lines=11) @@
1489
1490
        $base = 'messages-' . $date . '.log.html';
1491
1492
        if ($this->groupId && !$friendId) {
1493
            $base = 'messages-' . $date . '_gid-' . $this->groupId . '.log.html';
1494
        } elseif ($this->sessionId && !$friendId) {
1495
            $base = 'messages-' . $date . '_sid-' . $this->sessionId . '.log.html';
1496
        } elseif ($friendId) {
1497
            if ($this->userId < $friendId) {
1498
                $base = 'messages-' . $date . '_uid-' . $this->userId . '-' . $friendId . '.log.html';
1499
            } else {
1500
                $base = 'messages-' . $date . '_uid-' . $friendId . '-' . $this->userId . '.log.html';
1501
            }
1502
        }
1503
1504
        if (!$absolute) {
1505
            return $base;
@@ 1569-1579 (lines=11) @@
1566
1567
        $filename_chat = 'messages-' . $date_now . '.log.html';
1568
1569
        if ($this->groupId && !$friendId) {
1570
            $filename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId . '.log.html';
1571
        } else if ($this->sessionId && !$friendId) {
1572
            $filename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId . '.log.html';
1573
        } elseif ($friendId) {
1574
            if ($this->userId < $friendId) {
1575
                $filename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId . '.log.html';
1576
            } else {
1577
                $filename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId . '.log.html';
1578
            }
1579
        }
1580
1581
        if (!file_exists($chat_path . $filename_chat)) {
1582
            @fclose(fopen($chat_path . $filename_chat, 'w'));