Issues (287)

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.

UnusedSniffs/Files/AbstractClosingCommentSniff.php (2 issues)

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
 * CodeIgniter_Sniffs_Files_AbstractClosingCommentSniff.
4
 *
5
 * PHP version 5
6
 *
7
 * @category  PHP
8
 * @package   PHP_CodeSniffer
9
 * @author    Thomas Ernest <[email protected]>
10
 * @copyright 2006 Thomas Ernest
11
 * @license   http://thomas.ernest.fr/developement/php_cs/licence GNU General Public License
12
 * @link      http://pear.php.net/package/PHP_CodeSniffer
13
 */
14
15
/**
16
 * CodeIgniter_Sniffs_Files_AbstractClosingCommentSniff.
17
 *
18
 * Defines some methods used by
19
 * CodeIgniter_Sniffs_Files_ClosingFileCommentSniff
20
 * and CodeIgniter_Sniffs_Files_ClosingLocationCommentSniff.
21
 *
22
 * @category  PHP
23
 * @package   PHP_CodeSniffer
24
 * @author    Thomas Ernest <[email protected]>
25
 * @copyright 2006 Thomas Ernest
26
 * @license   http://thomas.ernest.fr/developement/php_cs/licence GNU General Public License
27
 * @link      http://pear.php.net/package/PHP_CodeSniffer
28
 */
29
30
namespace CodeIgniter\Sniffs\Files;
31
32
use PHP_CodeSniffer\Sniffs\Sniff;
33
use PHP_CodeSniffer\Files\File;
34
35
class AbstractClosingCommentSniff implements Sniff
36
{
37
    /**
38
     * As an abstract class, this sniff is not associated to any token.
39
     */
40
    public function register()
41
    {
42
      return array();
43
    }
44
45
    /**
46
     * As an abstract class, this sniff is not dedicated to process a token.
47
     */
48
    public function process(File $phpcsFile, $stackPtr)
49
    {
50
      $error = __CLASS__.'::'.__METHOD__.' is abstract. Please develop this method in a child class.';
51
      throw new PHP_CodeSniffer_Exception($error);
52
    }
53
54
    /**
55
     * Returns the comment without its delimiter(s) as well as leading
56
     * and traling whitespaces.
57
     *
58
     * It removes the first #, the two first / (i.e. //) or the first /*
59
     * and last \*\/. If a comment starts with /**, then the last * will remain
60
     * as well as whitespaces between this star and the comment content.
61
     *
62
     * @param string $comment Comment containing either comment delimiter(s) and
63
     * trailing or leading whitspaces to clean.
64
     *
65
     * @return string Comment without comment delimiter(s) and whitespaces.
66
     */
67
    protected static function _getCommentContent ($comment)
68
    {
69
        if (self::_stringStartsWith($comment, '#')) {
70
            $comment = substr($comment, 1);
71
        } else if (self::_stringStartsWith($comment, '//')) {
72
            $comment = substr($comment, 2);
73
        } else if (self::_stringStartsWith($comment, '/*')) {
74
            $comment = substr($comment, 2, strlen($comment) - 2 - 2);
75
        }
76
        $comment = trim($comment);
77
        return $comment;
78
    }//_getCommentContent()
79
80
81
    /**
82
     * Binary safe string comparison between $needle and
83
     * the beginning of $haystack. Returns true if $haystack starts with
84
     * $needle, false otherwise.
85
     *
86
     * @param string $haystack The string to search in.
87
     * @param string $needle   The string to search for.
88
     *
89
     * @return bool true if $haystack starts with $needle, false otherwise.
90
     */
91
    protected static function _stringStartsWith ($haystack, $needle)
92
    {
93
        $startsWith = false;
94
        if (strlen($needle) <= strlen($haystack)) {
95
            $haystackBeginning = substr($haystack, 0, strlen($needle));
96
            if (0 === strcmp($haystackBeginning, $needle)) {
97
                $startsWith = true;
98
            }
99
        }
100
        return $startsWith;
101
    }//_stringStartsWith()
102
}//end class
103
104
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
105