Issues (380)

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/ReadforumHandler.php (1 issue)

1
<?php
2
3
namespace XoopsModules\Newbb;
4
5
//
6
//  ------------------------------------------------------------------------ //
7
//                XOOPS - PHP Content Management System                      //
8
//                  Copyright (c) 2000-2020 XOOPS.org                        //
9
//                       <https://xoops.org>                             //
10
//  ------------------------------------------------------------------------ //
11
//  This program is free software; you can redistribute it and/or modify     //
12
//  it under the terms of the GNU General Public License as published by     //
13
//  the Free Software Foundation; either version 2 of the License, or        //
14
//  (at your option) any later version.                                      //
15
//                                                                           //
16
//  You may not change or alter any portion of this comment or credits       //
17
//  of supporting developers from this source code or any supporting         //
18
//  source code which is considered copyrighted (c) material of the          //
19
//  original comment or credit authors.                                      //
20
//                                                                           //
21
//  This program is distributed in the hope that it will be useful,          //
22
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
23
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
24
//  GNU General Public License for more details.                             //
25
//                                                                           //
26
//  You should have received a copy of the GNU General Public License        //
27
//  along with this program; if not, write to the Free Software              //
28
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
29
//  ------------------------------------------------------------------------ //
30
//  Author: phppp (D.J., [email protected])                                  //
31
//  URL: https://xoops.org                                                    //
32
//  Project: Article Project                                                 //
33
//  ------------------------------------------------------------------------ //
34
35
use XoopsModules\Newbb;
36
37
require_once __DIR__ . '/Read.php';
38
39
/**
40
 * A handler for read/unread handling
41
 *
42
 * @package       newbb
43
 *
44
 * @author        D.J. (phppp, http://xoopsforge.com)
45
 * @copyright     copyright (c) 2005 XOOPS.org
46
 */
47
48
/**
49
 * Class ReadforumHandler
50
 */
51
class ReadforumHandler extends Newbb\ReadHandler
52
{
53
    /**
54
     * @param \XoopsDatabase|null $db
55
     */
56
    public function __construct(\XoopsDatabase $db = null)
57
    {
58
        parent::__construct($db, 'forum');
59
    }
60
61
    /**
62
     * clean orphan items from database
63
     *
64
     * @param string $table_link
65
     * @param string $field_link
66
     * @param string $field_object
67
     * @return bool   true on success
68
     */
69
    public function cleanOrphan($table_link = '', $field_link = '', $field_object = '') //cleanOrphan()
70
    {
71
        parent::cleanOrphan($this->db->prefix('newbb_posts'), 'post_id');
72
73
        return parent::cleanOrphan($this->db->prefix('newbb_forums'), 'forum_id', 'read_item');
74
    }
75
76
    /**
77
     * @param int  $status
78
     * @param null $uid
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $uid is correct as it would always require null to be passed?
Loading history...
79
     * @return bool
80
     */
81
    public function setReadItems($status = 0, $uid = null)
82
    {
83
        if (empty($this->mode)) {
84
            return true;
85
        }
86
87
        if (1 == $this->mode) {
88
            return $this->setReadItemsCookie($status);
89
        }
90
91
        return $this->setReadItemsDb($status, $uid);
92
    }
93
94
    /**
95
     * @param $status
96
     * @param $items
97
     * @return bool
98
     */
99
    public function setReadItemsCookie($status, $items)
100
    {
101
        $cookie_name = 'LF';
102
        $items       = [];
103
        if (!empty($status)) {
104
            /** @var Newbb\ForumHandler $itemHandler */
105
            $itemHandler = \XoopsModules\Newbb\Helper::getInstance()->getHandler('Forum');
106
            $items_id    = $itemHandler->getIds();
107
            foreach ($items_id as $key) {
108
                $items[$key] = \time();
109
            }
110
        }
111
        \newbbSetCookie($cookie_name, $items);
112
113
        return true;
114
    }
115
116
    /**
117
     * @param $status
118
     * @param $uid
119
     * @return bool
120
     */
121
    public function setReadItemsDb($status, $uid)
122
    {
123
        if (empty($uid)) {
124
            if (\is_object($GLOBALS['xoopsUser'])) {
125
                $uid = $GLOBALS['xoopsUser']->getVar('uid');
126
            } else {
127
                return false;
128
            }
129
        }
130
        if (empty($status)) {
131
            $this->deleteAll(new \Criteria('uid', $uid));
132
133
            return true;
134
        }
135
136
        /** @var Newbb\ForumHandler $itemHandler */
137
        $itemHandler = \XoopsModules\Newbb\Helper::getInstance()->getHandler('Forum');
138
        $itemsObject = $itemHandler->getAll(null, ['forum_last_post_id']);
139
        foreach (\array_keys($itemsObject) as $key) {
140
            $this->setReadDb($key, $itemsObject[$key]->getVar('forum_last_post_id'), $uid);
141
        }
142
        unset($itemsObject);
143
144
        return true;
145
    }
146
147
    /**
148
     * @return bool|void
149
     */
150
    public function synchronization()
151
    {
152
        //        return;
153
    }
154
}
155