Issues (964)

Security Analysis    not enabled

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

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

testdata/mymodule2/class/Articleshandler.php (4 issues)

Labels
1
<?php
2
3
namespace XoopsModules\Mymodule2;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
*/
14
15
/**
16
 * My Module 2 module for xoops
17
 *
18
 * @copyright     2020 XOOPS Project (https://xooops.org)
19
 * @license        GPL 2.0 or later
20
 * @package        mymodule2
21
 * @since          1.0
22
 * @min_xoops      2.5.9
23
 * @author         TDM XOOPS - Email:<[email protected]> - Website:<http://xoops.org>
24
 */
25
26
use XoopsModules\Mymodule2;
27
28
29
/**
30
 * Class Object Handler Articles
31
 */
32
class ArticlesHandler extends \XoopsPersistableObjectHandler
33
{
34
	/**
35
	 * Constructor 
36
	 *
37
	 * @param null|XoopsDatabase $db
0 ignored issues
show
The type XoopsModules\Mymodule2\XoopsDatabase was not found. Did you mean XoopsDatabase? If so, make sure to prefix the type with \.
Loading history...
38
	 */
39
	public function __construct(\XoopsDatabase $db)
40
	{
41
		parent::__construct($db, 'mymodule2_articles', Articles::class, 'art_id', 'art_title');
42
	}
43
44
	/**
45
	 * @param bool $isNew
46
	 *
47
	 * @return object
48
	 */
49
	public function create($isNew = true)
50
	{
51
		return parent::create($isNew);
52
	}
53
54
	/**
55
	 * retrieve a field
56
	 *
57
	 * @param int $i field id
58
	 * @param null fields
0 ignored issues
show
The type XoopsModules\Mymodule2\fields was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
59
	 * @return mixed reference to the {@link Get} object
60
	 */
61
	public function get($i = null, $fields = null)
62
	{
63
		return parent::get($i, $fields);
64
	}
65
66
	/**
67
	 * get inserted id
68
	 *
69
	 * @param null
70
	 * @return integer reference to the {@link Get} object
71
	 */
72
	public function getInsertId()
73
	{
74
		return $this->db->getInsertId();
75
	}
76
77
	/**
78
	 * Get Count Articles in the database
79
	 * @param int    $start 
80
	 * @param int    $limit 
81
	 * @param string $sort 
82
	 * @param string $order 
83
	 * @return int
84
	 */
85
	public function getCountArticles($start = 0, $limit = 0, $sort = 'art_id ASC, art_title', $order = 'ASC')
86
	{
87
		$crCountArticles = new \CriteriaCompo();
88
		$crCountArticles = $this->getArticlesCriteria($crCountArticles, $start, $limit, $sort, $order);
89
		return parent::getCount($crCountArticles);
0 ignored issues
show
$crCountArticles of type integer is incompatible with the type CriteriaElement|null expected by parameter $criteria of XoopsPersistableObjectHandler::getCount(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

89
		return parent::getCount(/** @scrutinizer ignore-type */ $crCountArticles);
Loading history...
90
	}
91
92
	/**
93
	 * Get All Articles in the database
94
	 * @param int    $start 
95
	 * @param int    $limit 
96
	 * @param string $sort 
97
	 * @param string $order 
98
	 * @return array
99
	 */
100
	public function getAllArticles($start = 0, $limit = 0, $sort = 'art_id ASC, art_title', $order = 'ASC')
101
	{
102
		$crAllArticles = new \CriteriaCompo();
103
		$crAllArticles = $this->getArticlesCriteria($crAllArticles, $start, $limit, $sort, $order);
104
		return parent::getAll($crAllArticles);
0 ignored issues
show
$crAllArticles of type integer is incompatible with the type CriteriaElement|null expected by parameter $criteria of XoopsPersistableObjectHandler::getAll(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

104
		return parent::getAll(/** @scrutinizer ignore-type */ $crAllArticles);
Loading history...
105
	}
106
107
	/**
108
	 * Get Criteria Articles
109
	 * @param        $crArticles
110
	 * @param int    $start 
111
	 * @param int    $limit 
112
	 * @param string $sort 
113
	 * @param string $order 
114
	 * @return int
115
	 */
116
	private function getArticlesCriteria($crArticles, $start, $limit, $sort, $order)
117
	{
118
		$crArticles->setStart( $start );
119
		$crArticles->setLimit( $limit );
120
		$crArticles->setSort( $sort );
121
		$crArticles->setOrder( $order );
122
		return $crArticles;
123
	}
124
}
125