Code Duplication    Length = 16-16 lines in 2 locations

ajaxfilelist.php 1 location

@@ 38-53 (lines=16) @@
35
 *
36
 * @return string
37
 */
38
function getUserName($uid)
39
{
40
    global $xoopsConfig;
41
42
    $uid = (int)$uid;
43
44
    if ($uid > 0) {
45
        $memberHandler = xoops_getHandler('member');
46
        $user          = $memberHandler->getUser($uid);
47
        if (is_object($user)) {
48
            return "<a href=\"" . XOOPS_URL . "/userinfo.php?uid=$uid\">" . htmlspecialchars($user->getVar('uname'), ENT_QUOTES) . '</a>';
49
        }
50
    }
51
52
    return $xoopsConfig['anonymous'];
53
}
54
55
// $_GET variables we use
56
unset($page, $bid, $id);

class/GwikiPage.php 1 location

@@ 694-709 (lines=16) @@
691
     *
692
     * @return string
693
     */
694
    public function getUserName($uid)
695
    {
696
        global $xoopsConfig;
697
698
        $uid = (int)$uid;
699
700
        if ($uid > 0) {
701
            $memberHandler = xoops_getHandler('member');
702
            $user          = $memberHandler->getUser($uid);
703
            if (is_object($user)) {
704
                return "<a href=\"" . XOOPS_URL . "/userinfo.php?uid=$uid\">" . htmlspecialchars($user->getVar('uname'), ENT_QUOTES) . '</a>';
705
            }
706
        }
707
708
        return $xoopsConfig['anonymous'];
709
    }
710
711
    /**
712
     * get array of prefixes user can edit