Passed
Push — 1.11.x ( bce6cd...c146d9 )
by Angel Fernando Quiroz
12:25
created

main/work/show_file.php (1 issue)

1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
/**
6
 * This file is responsible for  passing requested documents to the browser.
7
 * Html files are parsed to fix a few problems with URLs,
8
 * but this code will hopefully be replaced soon by an Apache URL
9
 * rewrite mechanism.
10
 */
11
require_once __DIR__.'/../inc/global.inc.php';
12
require_once 'work.lib.php';
13
14
$current_course_tool = TOOL_STUDENTPUBLICATION;
15
$this_section = SECTION_COURSES;
16
17
// Course protection
18
api_protect_course_script(true);
19
$id = (int) ($_GET['id']);
20
$course_info = api_get_course_info();
21
22
if (empty($course_info)) {
23
    api_not_allowed(true);
24
}
25
26
$result = getFile($id, $course_info, false);
27
28
if (false == $result) {
0 ignored issues
show
Coding Style Best Practice introduced by
It seems like you are loosely comparing two booleans. Considering using the strict comparison === instead.

When comparing two booleans, it is generally considered safer to use the strict comparison operator.

Loading history...
29
    api_not_allowed();
30
}
31