Code Duplication    Length = 5-5 lines in 2 locations

main/social/profile.php 1 location

@@ 15-19 (lines=5) @@
12
$cidReset = true;
13
require_once __DIR__.'/../inc/global.inc.php';
14
15
if (api_get_setting('allow_social_tool') != 'true') {
16
    $url = api_get_path(WEB_PATH).'whoisonline.php?id='.intval($_GET['u']);
17
    header('Location: '.$url);
18
    exit;
19
}
20
21
$user_id = api_get_user_id();
22
$friendId = isset($_GET['u']) ? intval($_GET['u']) : api_get_user_id();

plugin/vchamilo/lib/Virtual.php 1 location

@@ 224-228 (lines=5) @@
221
     */
222
    public static function redirect($url)
223
    {
224
        if (preg_match('#https?://#', $url)) {
225
            header('location: '.$url);
226
        } else {
227
            header('location: ' . api_get_path(WEB_PATH).$url);
228
        }
229
        exit;
230
    }
231