Skip to content

Commit

Permalink
Merge pull request atutor#116 from stevenseeley/patch-9
Browse files Browse the repository at this point in the history
Update view_transcript.php, added basename() to prevent abitrary file reading
  • Loading branch information
ATutor committed Mar 24, 2016
2 parents cbfe7a1 + 1019731 commit 5da4de6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mods/_standard/chat/manage/view_transcript.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
require(AT_INCLUDE_PATH.'vitals.inc.php');


$file = AT_CONTENT_DIR . 'chat/'.$_SESSION['course_id'].'/tran/'.$_GET['t'].'.html';
$file = AT_CONTENT_DIR . 'chat/'.$_SESSION['course_id'].'/tran/'.basename($_GET['t']).'.html';
if (!file_exists($file)) {
$msg->addError('FILE_NOT_FOUND');
header('Location: index.php');
Expand All @@ -24,4 +24,4 @@
@readfile($file);
echo '</table>';
require(AT_INCLUDE_PATH.'footer.inc.php');
?>
?>

0 comments on commit 5da4de6

Please sign in to comment.