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

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