Completed
Push — master ( 234b0e...1578b3 )
by Michael
14s
created

myheader.php (3 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: myheader.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
// Title    : Frame Branding Hack for Xoops Mylinks        //
29
// Author   : Freeop                                       //
30
// Email    : [email protected]                  //
31
// Website  : http://www.Belizecountry.com                 //
32
// System   : Xoops RC 3.0.4 / 3.0.5             10-14-02  //
33
// Filename : myheader.php                                 //
34
// Type     : Module Hack for MyLinks                      //
35
/////////////////////////////////////////////////////////////
36
37
// Code below uses users current selected theme style      //
38
39
include 'header.php';
40
$url = htmlspecialchars(preg_replace('/javascript:/si', 'java script:', $_GET['url']));
41
include_once './class/utility.php';
42
//xoops_load('utility', $xoopsModule->getVar('dirname'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
77% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
43
44
$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...
45
$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...
46
47
echo '<html><head><style><!--.bg1 {    background-color : #E3E4E0;}.bg2 {    background-color : #e5e5e5;}.bg3 {     background-color : #f6f6f6;}.bg4 {    background-color : #f0f0f0;}.bg5 {    background-color : f8f8f8;}body { margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;font-family: Tahoma, taipei; color;#000000; font-size: 10px; background-color : #2F5376; color: #ffffff;}a {  font-weight: bold;font-family: Tahoma, taipei; font-size: 10px; text-decoration: none; color: #666666; font-style: normal}A:hover {  font-weight: bold;text-decoration: underline;  font-family: Tahoma, taipei; font-size: 10px; color: #FF9966; font-style: normal}td {  font-family: Tahoma, taipei; color: #000000; font-size: 10px;border-top-width : 1px; border-right-width : 1px; border-bottom-width : 1px; border-left-width : 1px;}img { border:0;}//--></style>';
48
$mail_subject = rawurlencode(sprintf(_MD_MYLINKS_INTRESTLINK, $xoopsConfig['sitename']));
49
$mail_body = rawurlencode(sprintf(_MD_MYLINKS_INTLINKFOUND, $xoopsConfig['sitename']) . ':  ' . XOOPSMYLINKURL . "/singlelink.php?cid={$cid}&amp;lid={$lid}");
50
51
echo '</head><body>'
52
     . "<table style='width: 100%; border-width: 0px; margin:0px; padding: 0px;'>\n"
53
     . "   <tr>\n"
54
     . "     <td style='width: 150px;'><a href='" . XOOPS_URL . "' target='_blank'><img src='" . XOOPS_URL . "/images/logo.gif' alt=''></a></td>\n"
55
     . "     <td style='width: 100%; text-align: center;'>\n"
56
     . "       <table class='bg3' style='width: 95%; margin: 2px; padding: 3px; border-width: 0px; border: #e0e0e0 1px solid;'>\n"
57
     . "         <tr>\n"
58
     . "           <td style='border-bottom: #e0e0e0 1px solid;'>\n"
59
     . '             <strong>' . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES) . "</strong>\n"
60
     . "           </td>\n"
61
     . "         </tr>\n"
62
     . "         <tr>\n"
63
     . "           <td class='bg4' style='text-align: center font-size: small;'>\n"
64
     . "             <a target='main' href='ratelink.php?cid={$cid}&amp;lid={$lid}'>" . _MD_MYLINKS_RATETHISSITE . "</a>&nbsp;|&nbsp;\n"
65
     . "             <a target='main' href='modlink.php?lid={$lid}'>" . _MD_MYLINKS_MODIFY . "</a>&nbsp;|&nbsp;\n"
66
     . "             <a target='main' href='brokenlink.php?lid={$lid}'>" . _MD_MYLINKS_REPORTBROKEN . "</a>&nbsp;|&nbsp;\n"
67
     . "             <a target='_top' href='mailto:?subject={$mail_subject}&amp;body={$mail_body}'>" . _MD_MYLINKS_TELLAFRIEND . '</a>&nbsp;|&nbsp;'
68
     . "             <a target='_top' href='" . XOOPS_URL . "'>" . _MD_MYLINKS_BACKTO . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES) . '</a>&nbsp;|&nbsp;'
69
     . "             <a target='_top' href='{$url}'>" . _MD_MYLINKS_CLOSEFRAME . "</a>\n"
70
     . "           </td>\n"
71
     . "         </tr>\n"
72
     . "       </table>\n"
73
     . "     </td>\n"
74
     . "   </tr>\n"
75
     . "</table>\n"
76
     . "</body></html>\n";
77