Issues (141)

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.

formats/slideshow/SRF_SlideShow.php (1 issue)

Labels
Severity

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
/**
3
 * File holding the SRF_SlideShow class
4
 *
5
 * @author Stephan Gambke
6
 * @file
7
 * @ingroup SemanticResultFormats
8
 */
9
10
/**
11
 * The SRF_SlideShow class.
12
 *
13
 * @ingroup SemanticResultFormats
14
 */
15
class SRFSlideShow extends SMWResultPrinter {
16
17
	/**
18
	 * Get a human readable label for this printer.
19
	 *
20
	 * @return string
21
	 */
22
	public function getName() {
23
		return wfMessage( 'srf-printername-slideshow' )->text();
24
	}
25
26
	/**
27
	 * Return serialised results in specified format.
28
	 * Implemented by subclasses.
29
	 */
30
	protected function getResultText( SMWQueryResult $res, $outputmode ) {
31
32
		$html = '';
33
		$id = uniqid();
34
35
		// build an array of article IDs contained in the result set
36
		$objects = [];
37
		foreach ( $res->getResults() as $key => $dataItem ) {
38
39
			$objects[] = [ $dataItem->getTitle()->getArticleId() ];
40
41
			$html .= $key . ': ' . $dataItem->getSerialization() . "<br>\n";
42
		}
43
44
		// build an array of data about the printrequests
45
		$printrequests = [];
46
		foreach ( $res->getPrintRequests() as $key => $printrequest ) {
47
			$data = $printrequest->getData();
48
			if ( $data instanceof SMWPropertyValue ) {
0 ignored issues
show
The class SMWPropertyValue does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
49
				$name = $data->getDataItem()->getKey();
50
			} else {
51
				$name = null;
52
			}
53
			$printrequests[] = [
54
				$printrequest->getMode(),
55
				$printrequest->getLabel(),
56
				$name,
57
				$printrequest->getOutputFormat(),
58
				$printrequest->getParameters(),
59
			];
60
61
		}
62
63
		// write out results and query params into JS arrays
64
		// Define the srf_filtered_values array
65
		SMWOutputs::requireScript(
66
			'srf_slideshow',
67
			Html::inlineScript(
68
				'srf_slideshow = {};'
69
			)
70
		);
71
72
		SMWOutputs::requireScript(
73
			'srf_slideshow' . $id,
74
			Html::inlineScript(
75
				'srf_slideshow["' . $id . '"] = ' . json_encode(
76
					[
77
						$objects,
78
						$this->params['template'],
79
						$this->params['delay'] * 1000,
80
						$this->params['height'],
81
						$this->params['width'],
82
						$this->params['nav controls'],
83
						$this->params['effect'],
84
						json_encode( $printrequests ),
85
					]
86
				) . ';'
87
			)
88
		);
89
90
		SMWOutputs::requireResource( 'ext.srf.slideshow' );
91
92
		if ( $this->params['nav controls'] ) {
93
			SMWOutputs::requireResource( 'jquery.ui.slider' );
94
		}
95
96
		return Html::element(
97
			'div',
98
			[
99
				'id' => $id,
100
				'class' => 'srf-slideshow ' . $id . ' ' . $this->params['class']
101
			]
102
		);
103
	}
104
105
	/**
106
	 * Check whether a "further results" link would normally be generated for this
107
	 * result set with the given parameters.
108
	 *
109
	 * @param SMWQueryResult $results
110
	 *
111
	 * @return boolean
112
	 */
113
	protected function linkFurtherResults( SMWQueryResult $results ) {
114
		return false;
115
	}
116
117
	/**
118
	 * @see SMWResultPrinter::getParamDefinitions
119
	 *
120
	 * @since 1.8
121
	 *
122
	 * @param $definitions array of IParamDefinition
123
	 *
124
	 * @return array of IParamDefinition|array
125
	 */
126
	public function getParamDefinitions( array $definitions ) {
127
		$params = parent::getParamDefinitions( $definitions );
128
129
		$params['template'] = [
130
			'default' => '',
131
			'message' => 'smw_paramdesc_template',
132
		];
133
134
		// TODO: Implement named args
135
//		$params['named args'] = new Parameter( 'named args', Parameter::TYPE_BOOLEAN, false );
136
//		$params['named args']->setMessage( 'smw_paramdesc_named_args' );
137
138
		$params['class'] = [
139
			'default' => '',
140
			'message' => 'srf-paramdesc-class',
141
		];
142
143
		$params['height'] = [
144
			'default' => '100px',
145
			'message' => 'srf-paramdesc-height',
146
		];
147
148
		$params['width'] = [
149
			'default' => '200px',
150
			'message' => 'srf-paramdesc-width',
151
		];
152
153
		$params['delay'] = [
154
			'type' => 'integer',
155
			'default' => 5,
156
			'message' => 'srf-paramdesc-delay',
157
		];
158
159
		$params['nav controls'] = [
160
			'type' => 'boolean',
161
			'default' => false,
162
			'message' => 'srf-paramdesc-navigation-controls',
163
		];
164
165
		$params['effect'] = [
166
			'default' => 'none',
167
			'message' => 'srf-paramdesc-effect',
168
			'values' => [
169
				'none',
170
				'slide left',
171
				'slide right',
172
				'slide up',
173
				'slide down',
174
				'fade',
175
				'hide',
176
			],
177
		];
178
179
		return $params;
180
	}
181
182
}
183