Passed
Push — 1.11.x ( bce6cd...c146d9 )
by Angel Fernando Quiroz
12:25
created

plugin/jcapture/applet.php (4 issues)

1
<?php
2
3
//fix for Opera XMLHttpRequests
4
if (!count($_POST) && $HTTP_RAW_POST_DATA) {
5
    parse_str($HTTP_RAW_POST_DATA, $_POST);
6
}
7
8
if (!defined('DOKU_INC')) {
9
    define('DOKU_INC', __DIR__.'/../../../');
10
}
11
require_once DOKU_INC.'inc/init.php';
12
require_once DOKU_INC.'inc/common.php';
13
require_once DOKU_INC.'inc/pageutils.php';
14
require_once DOKU_INC.'inc/auth.php';
15
//close sesseion
16
session_write_close();
17
header('Content-Type: text/html; charset=utf-8');
18
$hostName = "http".($_SERVER['HTTPS'] ? 's' : null).'://'.$_SERVER['HTTP_HOST'];
19
$imageFormat = "PNG";
20
$cookies = '';
21
foreach (array_keys($_COOKIE) as $cookieName) {
22
    $cookies .= bin2hex($cookieName)."=".bin2hex($_COOKIE[$cookieName]).";";
23
}
24
25
$pageName = $_GET["pageName"];
26
$edid = $_GET["edid"];
27
?>
28
<script language="JavaScript" type="text/javascript">
29
    var _info = navigator.userAgent;
30
    var _ns = false;
31
    var _ns6 = false;
32
    var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
33
</script>
34
<comment>
35
    <script language="JavaScript" type="text/javascript">
36
    var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) || (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) || (_info.indexOf("IRIX") > 0)));
37
    var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
38
    </script>
39
</comment>
40
<script language="JavaScript" type="text/javascript"><!--
41
    if (_ie == true) document.writeln('<object classid="clsid:CAFEEFAC-0017-0000-0020-ABCDEFFEDCBA" NAME = "jCapture"  WIDTH = "1" HEIGHT = "1" codebase="http://java.sun.com/update/1.7.0/jinstall-1_7_0-windows-i586.cab#Version=7,0,0,0"><xmp>');
42
    else if (_ns == true && _ns6 == false) document.writeln('<embed ' +
43
	    'type="application/x-java-applet;jpi-version=1.7.0" \
44
            ID = "jCaptureApplet" \
45
            scriptable = "true" \
46
            mayscript = "true" \
47
            WIDTH = "1"
48
            JAVA_CODEBASE = "/somenonexistingcodebase" \
49
            HEIGHT = "1"
50
            CODE = "com.hammurapi.jcapture.JCaptureApplet.class" \
51
            ARCHIVE = "<?php echo DOKU_BASE; ?>lib/plugins/jcapture/lib/jcapture.jar" \
52
            NAME = "jCapture" \
53
            dokuBase ="<?php echo bin2hex(DOKU_BASE); ?>" \
54
            sectok ="<?php echo getSecurityToken(); ?>" \
0 ignored issues
show
Are you sure the usage of getSecurityToken() is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
55
            cookies ="<?php echo $cookies; ?>" \
56
            authtok = "<?php echo auth_createToken(); ?>" \
0 ignored issues
show
The function auth_createToken was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

56
            authtok = "<?php echo /** @scrutinizer ignore-call */ auth_createToken(); ?>" \
Loading history...
57
            pageName = "<?php echo $pageName; ?>" \
58
            edid = "<?php echo $edid; ?>" \
59
            host ="<?php echo $hostName; ?>" ' +
60
	    'scriptable=true ' +
61
	    'pluginspage="http://java.sun.com/products/plugin/index.html#download"><xmp>');
62
//--></script>
63
<applet id="jCaptureApplet" CODE = "com.hammurapi.jcapture.JCaptureApplet.class" WIDTH="1" HEIGHT="1" ARCHIVE = "<?php echo DOKU_BASE; ?>/lib/plugins/jcapture/lib/jcapture.jar" NAME = "jCapture"></xmp>
64
    <PARAM NAME = CODE VALUE = "com.hammurapi.jcapture.JCaptureApplet.class" >
65
    <PARAM NAME = ARCHIVE VALUE = "<?php echo DOKU_BASE; ?>lib/plugins/jcapture/lib/jcapture.jar" >
66
    <PARAM NAME = NAME VALUE = "jCapture" >
67
    <PARAM NAME="type" value="application/x-java-applet;jpi-version=1.7.0">
68
    <PARAM NAME="scriptable" value="true">
69
    <PARAM NAME="mayscript" value="true">
70
    <PARAM NAME = "dokuBase" VALUE="<?php echo bin2hex(DOKU_BASE); ?>">
71
    <PARAM NAME = "sectok" VALUE="<?php echo getSecurityToken(); ?>">
0 ignored issues
show
Are you sure the usage of getSecurityToken() is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
72
    <PARAM NAME = "cookies" VALUE="<?php echo $cookies; ?>">
73
    <PARAM NAME = "host" VALUE="<?php echo $hostName; ?>">
74
    <PARAM NAME = "pageName" VALUE="<?php echo $pageName; ?>">
75
    <PARAM NAME = "edid" VALUE="<?php echo $edid; ?>">
76
    <PARAM NAME = CODEBASE VALUE = "/somenonexistingcodebase" >
77
    <PARAM NAME = "authtok" VALUE="<?php echo auth_createToken(); ?>">
78
79
Java 2 Standard Edition v 1.7 or above is required for this applet.<br/>
80
		Download it from <a href="http://java.sun.com">http://java.sun.com</a>.
81
</applet>
82
</embed>
83
</object>
84
85
<!--
86
<APPLET CODE = "com.hammurapi.jcapture.JCaptureApplet.class" ARCHIVE = "<?php echo DOKU_BASE; ?>/lib/plugins/jcapture/lib/jcapture.jar" NAME = "jCapture">
87
<PARAM NAME = "dokuBase" VALUE="<?php echo bin2hex(DOKU_BASE); ?>">
88
<PARAM NAME = "sectok" VALUE="<?php echo getSecurityToken(); ?>">
0 ignored issues
show
Are you sure the usage of getSecurityToken() is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
89
<PARAM NAME = "cookies" VALUE="<?php echo $cookies; ?>">
90
<PARAM NAME = "host" VALUE="<?php echo $hostName; ?>">
91
Java 2 Standard Edition v 1.7 or above is required for this applet.<br/>
92
		Download it from <a href="http://java.sun.com">http://java.sun.com</a>.
93
94
</APPLET>
95
-->
96