Skip to content

Commit aa052c0

Browse files
committed
Update link_goto.php
1 parent f414513 commit aa052c0

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

main/link/link_goto.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,20 @@
2121
require_once '../inc/global.inc.php';
2222
$this_section = SECTION_COURSES;
2323

24-
$link_url = html_entity_decode(Security::remove_XSS($_GET['link_url']));
25-
$link_id = intval($_GET['link_id']);
24+
require_once api_get_path(LIBRARY_PATH).'link.lib.php';
2625

26+
$this_section = SECTION_COURSES;
27+
28+
$linkId = intval($_GET['link_id']);
29+
30+
$linkInfo = Link::get_link_info($linkId);
31+
$linkUrl = html_entity_decode(Security::remove_XSS($linkInfo['url']));
2732
// Launch event
28-
event_link($link_id);
33+
Event::event_link($linkId);
2934

3035
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
3136
header("Cache-Control: post-check=0, pre-check=0", false);
3237
header("Pragma: no-cache"); // HTTP/1.0
33-
header("Location: $link_url");
34-
35-
// To be sure that the script stops running after the redirection
38+
header("Location: $linkUrl");
3639
exit;
40+

0 commit comments

Comments
 (0)