Issues (896)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

templates/single-course/modules.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
if ( ! defined( 'ABSPATH' ) ) exit;
3
/**
4
 * List the Course Modules and Lesson in these modules
5
 *
6
 * Template is hooked into Single Course sensei_single_main_content. It will
7
 * only be shown if the course contains modules.
8
 *
9
 * All lessons shown here will not be included in the list of other lessons.
10
 *
11
 * @author 		Automattic
12
 * @package 	Sensei
13
 * @category    Templates
14
 * @version     1.9.0
15
 */
16
?>
17
18
<?php
19
20
    /**
21
     * Hook runs inside single-course/course-modules.php
22
     *
23
     * It runs before the modules are shown. This hook fires on the single course page. It will show
24
     * irrespective of irrespective the course has any modules or not.
25
     *
26
     * @since 1.8.0
27
     *
28
     */
29
    do_action('sensei_single_course_modules_before');
30
31
?>
32
33
<?php if( sensei_have_modules() ): ?>
34
35
    <?php while ( sensei_have_modules() ): sensei_setup_module(); ?>
36
        <?php if( sensei_module_has_lessons() ): ?>
37
38
            <article class="module">
39
40
                <?php
41
42
                /**
43
                 * Hook runs inside single-course/course-modules.php
44
                 *
45
                 * It runs inside the if statement after the article tag opens just before the modules are shown. This hook will NOT fire if there
46
                 * are no modules to show.
47
                 *
48
                 * @since 1.9.0
49
                 *
50
                 * @hooked Sensei()->modules->course_modules_title - 20
51
                 */
52
                do_action('sensei_single_course_modules_inside_before');
53
54
                ?>
55
56
                <header>
57
58
                    <h2>
59
60
                        <a href="<?php sensei_the_module_permalink(); ?>" title="<?php sensei_the_module_title_attribute();?>">
61
62
                            <?php sensei_the_module_title(); ?>
63
64
                        </a>
65
66
                    </h2>
67
68
                </header>
69
70
                <section class="entry">
71
72
                    <?php sensei_the_module_status(); ?>
73
74
                    <section class="module-lessons">
75
76
                        <header>
77
78
                            <h3><?php _e('Lessons', 'woothemes-sensei') ?></h3>
79
80
                        </header>
81
82
                        <ul class="lessons-list" >
83
84
                            <?php while( sensei_module_has_lessons() ): the_post(); ?>
85
86
                                <li class="<?php sensei_the_lesson_status_class();?>">
87
88
                                    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute() ?>" >
89
90
                                        <?php the_title(); ?>
91
92
	                                    <?php
93
	                                    $course_id = Sensei()->lesson->get_course_id( get_the_ID() );
94
	                                    if ( Sensei_Utils::is_preview_lesson( get_the_ID() ) && ! Sensei_Utils::user_started_course( $course_id, get_current_user_id() )  ) { ?>
0 ignored issues
show
It seems like $course_id defined by Sensei()->lesson->get_course_id(get_the_ID()) on line 93 can also be of type boolean; however, Sensei_Utils::user_started_course() does only seem to accept integer, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
95
96
	                                        <span class="preview-label">Free Preview</span>
97
98
                                        <?php } ?>
99
100
                                    </a>
101
102
                                </li>
103
104
                            <?php endwhile; ?>
105
106
                        </ul>
107
108
                    </section><!-- .module-lessons -->
109
110
                </section>
111
112
                <?php
113
114
                /**
115
                 * Hook runs inside single-course/course-modules.php
116
                 *
117
                 * It runs inside the if statement before the closing article tag directly after the modules were shown.
118
                 * This hook will not trigger if there are no modules to show.
119
                 *
120
                 * @since 1.9.0
121
                 *
122
                 */
123
                do_action('sensei_single_course_modules_inside_after');
124
125
                ?>
126
127
            </article>
128
129
        <?php endif; //sensei_module_has_lessons  ?>
130
131
    <?php endwhile; // sensei_have_modules ?>
132
133
<?php endif; // sensei_have_modules ?>
134
135
<?php
136
137
/**
138
 * Hook runs inside single-course/course-modules.php
139
 *
140
 * It runs after the modules are shown. This hook fires on the single course page,but only if the course has modules.
141
 *
142
 * @since 1.8.0
143
 */
144
do_action('sensei_single_course_modules_after');
145