Issues (661)

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.

qrcode.php (4 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
// $Id: qrcode.php 11158 2013-03-05 14:10:36Z zyspec $
3
//  ------------------------------------------------------------------------ //
4
//                XOOPS - PHP Content Management System                      //
5
//                    Copyright (c) 2000 XOOPS.org                           //
6
//                       <http://www.xoops.org/>                             //
7
// ------------------------------------------------------------------------- //
8
//  This program is free software; you can redistribute it and/or modify     //
9
//  it under the terms of the GNU General Public License as published by     //
10
//  the Free Software Foundation; either version 2 of the License, or        //
11
//  (at your option) any later version.                                      //
12
//                                                                           //
13
//  You may not change or alter any portion of this comment or credits       //
14
//  of supporting developers from this source code or any supporting         //
15
//  source code which is considered copyrighted (c) material of the          //
16
//  original comment or credit authors.                                      //
17
//                                                                           //
18
//  This program is distributed in the hope that it will be useful,          //
19
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
20
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
21
//  GNU General Public License for more details.                             //
22
//                                                                           //
23
//  You should have received a copy of the GNU General Public License        //
24
//  along with this program; if not, write to the Free Software              //
25
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
26
//  ------------------------------------------------------------------------ //
27
28
include __DIR__ . '/header.php';
29
include_once __DIR__ . '/class/utility.php';
30
//xoops_load('utility', $xoopsModule->getVar('dirname'));
31
32
$lid = MylinksUtility::mylinks_cleanVars($_GET, 'lid', 0, 'int', array('min' => 0));
0 ignored issues
show
'lid' is of type string, but the function expects a object<unknown_type>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
33
$cid = MylinksUtility::mylinks_cleanVars($_GET, 'cid', 0, 'int', array('min' => 0));
0 ignored issues
show
'cid' is of type string, but the function expects a object<unknown_type>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
34
if (empty($lid) || empty($cid)) {
35
    redirect_header('index.php', 3, _MD_MYLINKS_IDERROR);
36
}
37
/*
38
$lid = isset($_GET['lid']) ? intval($_GET['lid']) : 0;
39
$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
40
if ( empty($lid) ) {
41
  die("No lid!");
42
} elseif ( empty($cid) ) {
43
  die("No cid!");
44
}
45
*/
46
$result = $xoopsDB->query('SELECT l.lid, l.cid, l.title, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description FROM ' . $xoopsDB->prefix('mylinks_links') . ' l, ' . $xoopsDB->prefix('mylinks_text') . " t where l.lid={$lid} AND l.lid=t.lid and status>0");
47
if (!$result) {
48
    redirect_header('index.php', 3, _MD_MYLINKS_NORECORDFOUND);
49
    exit();
50
}
51
52
list($lid, $cid, $ltitle, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result);
53
54
//qrcode func
55 View Code Duplication
switch ($mylinks_can_qrcode) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
56
    case _MD_MYLINKS_MEMBERONLY:
57
        $can_qrcode = $xoopsUser ? _MD_MYLINKS_ALLOW : _MD_MYLINKS_DISALLOW;
58
        break;
59
    case _MD_MYLINKS_ALLOW:
60
        $can_qrcode = _MD_MYLINKS_ALLOW;
61
        break;
62
    case _MD_MYLINKS_DISALLOW:
63
    default:
64
        $can_qrcode = _MD_MYLINKS_DISALLOW;
65
        break;
66
}
67
/*
68
if ( _MD_MYLINKS_DISALLOW == $can_qrcode ) {
69
    $xoopsTpl->assign( 'mylinksextrafuncqrcode' , false );
70
} else {
71
    $xoopsTpl->assign( 'mylinksextrafuncqrcode' , true );
72
}
73
74
$can_qrcode = 0;
75
if ( $mylinks_can_qrcode == 0 ) {
76
  $can_qrcode = 0;
77
}
78
else if ( $mylinks_can_qrcode == 1) {
79
  $can_qrcode = 1;
80
}
81
else if ( $mylinks_can_qrcode == 2) {
82
  if ( $xoopsUser ) {
83
  $can_qrcode =1;
84
  }
85
  else {
86
  $can_qrcode =0;
87
  }
88
}
89
else {
90
  $can_qrcode = 0;
91
}
92
*/
93
if (_MD_MYLINKS_DISALLOW == $can_qrcode) {
94
    redirect_header('index.php', 3, _MD_MYLINKS_QRCODEDISALLOWED);
95
    exit();
96
}
97
98
$myts = MyTextSanitizer::getInstance();
99
100
/**
101
 * @param        $str
102
 * @param string $to
103
 * @param string $from
104
 * @return array|string
105
 */
106 View Code Duplication
function mylinks_qrcode_convert_encoding($str, $to = 'SJIS', $from = _CHARSET)
0 ignored issues
show
This function seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
107
{
108
    if (function_exists('mb_convert_encoding')) {
109
        if (is_array($str)) {
110
            foreach ($str as $key => $val) {
111
                $str[$key] = mylinks_qrcode_convert_encoding($val, $to, $from);
112
            }
113
114
            return $str;
115
        } else {
116
            return mb_convert_encoding($str, $to, $from);
117
        }
118
    } else {
119
        return $str;
120
    }
121
}
122
123
/**
124
 * @param string $data
125
 * @return array|string
126
 */
127
function mylinks_qrcode_encoding($data = '')
128
{
129
    $data = mylinks_qrcode_convert_encoding($data);
130
    $data = rawurlencode($data);
131
    $data = ereg_replace('%20', '+', $data);
132
133
    return $data;
134
}
135
136
$link_data          = array();
137
$link_data['text']  = $myts->displayTarea($myts->stripSlashesGPC($description, 0));
138
$link_data['title'] = $myts->htmlSpecialChars($myts->stripSlashesGPC($ltitle));
139
$link_data['url']   = $myts->htmlSpecialChars($url);
140
$data               = "{$link_data['title']}\r\n{$link_data['url']}\r\n{$link_data['text']}";
141
$qrcodedata         = mylinks_qrcode_encoding($data);
142
$linkqrcode         = "<img alt='qrcode of linkdata' title='qrcode of linkdata'src='" . XOOPS_URL . "/modules/qrcode/qrcode_image.php?d={$qrcodedata}&amp;e=M&amp;s=4&amp;v=0&amp;t=P&amp;rgb=000000'>\n";
143
144
echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n" . "<html>\n" . "<head>\n" . '<title>' . $xoopsConfig['sitename'] . "</title>\n" . "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "'>\n" . "<meta name='AUTHOR' content='" . $xoopsConfig['sitename']
145
     . "'>\n" . "<meta name='COPYRIGHT' content='Copyright (c) " . date('Y') . ' by ' . $xoopsConfig['sitename'] . "'>\n" . "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "'>\n" . "<meta name='GENERATOR' content='" . XOOPS_VERSION . "'>\n" . "</head>\n"
146
     . "<body style='background-color: #ffffff; color: #000000;'>\n" . "  <div style='width: 750px; border: 1px solid #000; padding: 20px;'>\n" . "    <div style='text-align: center; display: block; margin: 0 0 6px 0;'>\n" . "      <h2 style='margin: 0px;'>" . _MD_MYLINKS_SITETITLE
147
     . "&nbsp;{$link_data['title']}</h2>\n" . "    </div>\n" . "    <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div>\n" . "    <div style='text-align: left'>" . _MD_MYLINKS_SITEURL
148
     . "&nbsp;:&nbsp;{$link_data['url']}</div>\n" . "    <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div>\n" . "    <div style='text-align: left'>" . _MD_MYLINKS_DESCRIPTIONC . '<br>' . $link_data['text'] . "</div>\n"
149
     . "    <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div>\n" . "    <div style='text-align: left'>LINK DATA QRCODE<br>{$linkqrcode}</div>\n" . "    <div style='padding-top: 12px; border-top: 2px solid #ccc;'></div>\n"
150
     . '      <p>From: &nbsp;' . XOOPSMYLINKURL . "/singlelink.php?cid={$cid}&amp;lid={$lid}</p>\n" . "    </div>\n" . "    <br>\n" . "    <br>\n" . "</body>\n" . '</html>';
151