Browse Source

Only need the id to load the link URL.

Julio Montoya 9 years ago
parent
commit
c28f045481
1 changed files with 5 additions and 6 deletions
  1. 5 6
      main/link/link_goto.php

+ 5 - 6
main/link/link_goto.php

@@ -21,16 +21,15 @@
 require_once '../inc/global.inc.php';
 $this_section = SECTION_COURSES;
 
-$link_url = html_entity_decode(Security::remove_XSS($_GET['link_url']));
-$link_id = intval($_GET['link_id']);
+$linkId = intval($_GET['link_id']);
 
+$linkInfo = Link::get_link_info($linkId);
+$linkUrl = html_entity_decode(Security::remove_XSS($linkInfo['url']));
 // Launch event
-Event::event_link($link_id);
+Event::event_link($linkId);
 
 header("Cache-Control: no-store, no-cache, must-revalidate");   // HTTP/1.1
 header("Cache-Control: post-check=0, pre-check=0", false);
 header("Pragma: no-cache");                                     // HTTP/1.0
-header("Location: $link_url");
-
-// To be sure that the script stops running after the redirection
+header("Location: $linkUrl");
 exit;