Issues (116)

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.

class/Plugin/SystemPlugin.php (4 issues)

1
<?php
2
3
namespace XoopsModules\Xooghost\Plugin;
4
5
/**
6
 * Xooghost module
7
 *
8
 * You may not change or alter any portion of this comment or credits
9
 * of supporting developers from this source code or any supporting source code
10
 * which is considered copyrighted (c) material of the original comment or credit authors.
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 *
15
 * @copyright       XOOPS Project (https://xoops.org)
16
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
17
 * @package         Xooghost
18
 * @since           2.6.0
19
 * @author          Laurent JEN (Aka DuGris)
20
 */
21
class SystemPlugin extends \Xoops\Module\Plugin\PluginAbstract implements \SystemPluginInterface
22
{
23
    /**
24
     * @param int $uid
25
     *
26
     * @return mixed
27
     */
28
    public function userPosts($uid)
29
    {
30
        $helper = \XoopsModules\Xooghost\Helper::getInstance();
31
        $pageHandler = $helper->getHandler('Page');
32
33
        $criteria = new \CriteriaCompo();
34
        $criteria->add(new \Criteria('xooghost_online', 1));
35
        $criteria->add(new \Criteria('xooghost_published', time(), '<='));
36
        $criteria->add(new \Criteria('xooghost_uid', $uid));
37
38
        return $pageHandler->getCount($criteria);
0 ignored issues
show
The method getCount() does not exist on XoopsObjectHandler. ( Ignorable by Annotation )

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

38
        return $pageHandler->/** @scrutinizer ignore-call */ getCount($criteria);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
39
    }
40
41
    /**
42
     * @return bool
43
     */
44
    public function waiting()
45
    {
46
        $helper = \XoopsModules\Xooghost\Helper::getInstance();
47
        $pageHandler = $helper->getHandler('Page');
48
        $criteria = new \CriteriaCompo(new \Criteria('xooghost_online', 0));
49
        if ($count = $pageHandler->getCount($criteria)) {
50
            $ret['count'] = $count;
0 ignored issues
show
Comprehensibility Best Practice introduced by
$ret was never initialized. Although not strictly required by PHP, it is generally a good practice to add $ret = array(); before regardless.
Loading history...
51
            $ret['name'] = \Xoops::getInstance()->getHandlerModule()->getByDirname('xooghost')->getVar('name');
52
            $ret['link'] = \Xoops::getInstance()->url('modules/xooghost/admin/pages.php?online=0');
53
54
            return $ret;
55
        }
56
57
        return false;
0 ignored issues
show
Bug Best Practice introduced by
The expression return false returns the type false which is incompatible with the return type mandated by SystemPluginInterface::waiting() of array.

In the issue above, the returned value is violating the contract defined by the mentioned interface.

Let's take a look at an example:

interface HasName {
    /** @return string */
    public function getName();
}

class Name {
    public $name;
}

class User implements HasName {
    /** @return string|Name */
    public function getName() {
        return new Name('foo'); // This is a violation of the ``HasName`` interface
                                // which only allows a string value to be returned.
    }
}
Loading history...
58
    }
59
60
    /**
61
     * @param int $limit
62
     *
63
     * @return array
64
     */
65
    public function backend($limit = 10)
66
    {
67
        $xoops = \Xoops::getInstance();
68
        $helper = \XoopsModules\Xooghost\Helper::getInstance();
69
        $pageHandler = $helper->getHandler('Page');
70
71
        $ret = [];
72
        $messages = $pageHandler->getPublished('published', 'desc', 0, $limit);
0 ignored issues
show
The method getPublished() does not exist on XoopsObjectHandler. ( Ignorable by Annotation )

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

72
        /** @scrutinizer ignore-call */ 
73
        $messages = $pageHandler->getPublished('published', 'desc', 0, $limit);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
73
        foreach ($messages as $k => $message) {
74
            $ret[$k]['title'] = $message['xooghost_title'];
75
            $ret[$k]['link'] = $xoops->url('modules/xooghost/' . $message['xooghost_url']);
76
            $ret[$k]['content'] = $message['xooghost_content'];
77
            $ret[$k]['date'] = $message['xooghost_time'];
78
        }
79
80
        return $ret;
81
    }
82
83
    /**
84
     * @return array
85
     */
86
    public function userMenus()
87
    {
88
        return [];
89
    }
90
}
91