Issues (1177)

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.

application/helpers/javascript_helper.php (1 issue)

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
3
if (!defined('BASEPATH')) {
4
    exit('No direct script access allowed');
5
}
6
/**
7
 * Java Script helper
8
 */
9
10
/**
11
 * Show Roar message
12
 *
13
 * @param string $message
14
 * @param string|boolean $title
15
 * @param string $class
16
 * @param boolean $ret
17
 * @param bool $timeout
18
 * @return null|string
19
 */
20
function showMessage($message, $title = FALSE, $class = '', $ret = false, $timeout = false) {
21
    $del = [
22
            "'",
23
            '"',
24
           ];
25
26
    $message = str_replace($del, '', $message);
27
    $title = str_replace($del, '', $title);
28
29
    if ($title == FALSE) {
30
        $title = lang('Message') . ': ';
31
        if ($class == 'r') {
32
            $title = lang('Error') . ': ';
33
        }
34
        if ($class == 'g') {
35
            $title = lang('Success') . ': ';
36
        }
37
    }
38
    $CI = &get_instance();
39
    $message .= '<br/><strong>' . lang('Requests to the database') . ': ' . $CI->db->total_queries() . '</strong>';
40
41
    $message = str_replace(["\n", '<p>', '</p>'], ['<br/>', '', ''], $message);
42
    $title = str_replace(["\n", '<p>', '</p>'], ['<br/>', '', ''], $title);
43
44
    if (!$ret) {
45
        echo "<script type=\"text/javascript\"> showMessage('" . $title . "','" . $message . "','" . $class . "'); </script>";
46
    } elseif (!$timeout) {
47
        return "<script type=\"text/javascript\"> showMessage('" . $title . "','" . $message . "','" . $class . "'); </script>";
48
    } else {
49
        return "<script> setTimeout(function(){showMessage('" . $title . "','" . $message . "','" . $class . "');}, 300) </script>";
50
    }
51
}
52
53
/**
54
 *
55
 * @param string $url
56
 * @param string $selector
57
 */
58
function pjax($url, $selector = '#mainContent') {
59
    echo '<script>$.pjax({url: "' . $url . '", container:"' . $selector . '"}); </script>';
60
}
61
62
/**
63
 * Redirect function
64
 * @param string $location
65
 */
66
function ajax_redirect($location) {
67
    echo lang('Redirecting') . ': <b>' . $location . '</b> ' . "<script type='text/javascript'> setTimeout(\"location.href = '" . $location . "';\",50); </script>";
68
}
69
70
/**
71
 * Load content to DIV
72
 * @param string $div_id
73
 * @param string $url
74
 */
75
function updateDiv($div_id, $url) {
76
    echo "<script type=\"text/javascript\"> ajax_div('" . $div_id . "','" . $url . "'); </script>";
77
}
78
79
/**
80
 * Same function as above but with other name ;)
81
 * @param string $div_id
82
 * @param string $url
83
 */
84
function ajax_div($div_id, $url) {
85
    updateDiv($div_id, $url);
86
}
87
88
/**
89
 * Execute java script code
90
 * @param string $code
91
 */
92
function jsCode($code) {
93
94
    echo '<script type="text/javascript"> ' . $code . ' </script>';
95
}
96
97
if (!function_exists('checkAjaxRequest')) {
98
99
    /**
100
     * @return bool
101
     */
102
    function checkAjaxRequest() {
103
        $CI = &get_instance();
104
        if ($CI->input->server('HTTP_X_REQUESTED_WITH') != 'XMLHttpRequest') {
0 ignored issues
show
The if-else statement can be simplified to return !($CI->input->ser...) != 'XMLHttpRequest');.
Loading history...
105
            return false;
106
        } else {
107
            return true;
108
        }
109
    }
110
111
}
112
113
/* End of javascript helper */