Issues (10)

Security Analysis    no request data  

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.

src/WebinoDbDump/Db/Dump/Table/AbstractExtra.php (1 issue)

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
 * Webino (http://webino.sk)
4
 *
5
 * @link        https://github.com/webino/WebinoDbDump/ for the canonical source repository
6
 * @copyright   Copyright (c) 2014-2017 Webino, s. r. o. (http://webino.sk)
7
 * @license     BSD-3-Clause
8
 */
9
10
namespace WebinoDbDump\Db\Dump\Table;
11
12
use SplFileObject as File;
13
use WebinoDbDump\Db\Dump\Adapter;
14
use Zend\Db\ResultSet\ResultSet;
15
16
/**
17
 * Base class for a platform table triggers
18
 *
19
 * @author Peter Bačinský <[email protected]>
20
 */
21
abstract class AbstractExtra implements ExtraInterface
22
{
23
    /**
24
     * @var string
25
     */
26
    protected $tableName;
27
28
    /**
29
     * @var Adapter
30
     */
31
    protected $adapter;
32
33
    /**
34
     * @param string $tableName
35
     * @param Adapter $adapter
36
     */
37
    public function __construct($tableName, Adapter $adapter)
38
    {
39
        $this->tableName = $tableName;
40
        $this->adapter   = $adapter;
41
    }
42
43
    /**
44
     * @return \Zend\Db\Platform\PlatformInterface
45
     */
46
    protected function getPlatform()
47
    {
48
        return $this->adapter->getPlatform();
49
    }
50
51
    /**
52
     * @return ResultSet
53
     */
54
    abstract protected function show();
55
56
    /**
57
     * @param File $file
58
     * @param ResultSet $triggers
59
     * @return $this
60
     */
61
    abstract protected function write(File $file, ResultSet $triggers);
62
63
    /**
64
     * @param File $file
65
     * @return $this
66
     */
67
    public function writeIfAny(File $file)
68
    {
69
        $triggers = $this->show();
70
        if (!$triggers->count()) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $triggers->count() of type integer|null is loosely compared to false; this is ambiguous if the integer can be zero. You might want to explicitly use === null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For integer values, zero is a special case, in particular the following results might be unexpected:

0   == false // true
0   == null  // true
123 == false // false
123 == null  // false

// It is often better to use strict comparison
0 === false // false
0 === null  // false
Loading history...
71
            // nothing to write
72
            return $this;
73
        }
74
75
        $this->write($file, $triggers);
76
        return $this;
77
    }
78
}
79