Issues (125)

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.

code/LatLongField.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
class LatLongField extends FieldGroup
4
{
5
    protected $latField;
6
7
    protected $longField;
8
9
    protected $zoomField;
10
11
    protected $buttonText;
12
13
    private $guidePoints = null;
14
15
    private static $ctr = 0;
16
17
    /**
18
     * @param string[] $buttonText
19
     */
20 8
    public function __construct($children = array(), $buttonText = null)
21
    {
22 8
        ++self::$ctr;
23
24 8
        if ((sizeof($children) < 2) || (sizeof($children) > 3) ||
25 7
             (!$children[0] instanceof FormField) ||
26 7
             (!$children[1] instanceof FormField)
27 8
        ) {
28 1
            user_error('LatLongField argument 1 must be an array containing at least two FormField '.
29 1
                'objects for Lat/Long values, respectively.', E_USER_ERROR);
30
        }
31
32 7
        parent::__construct($children);
33
34 7
        $this->buttonText = $buttonText ? $buttonText : _t('LatLongField.LOOKUP', 'Search');
35 7
        $this->latField = $children[0]->getName();
36 7
        $this->longField = $children[1]->getName();
37
38 7
        if (sizeof($children) == 3) {
39 6
            $this->zoomField = $children[2]->getName();
40 6
        }
41 7
        $name = '';
42 7
        foreach ($children as $field) {
43 7
            $name .= $field->getName();
44 7
        }
45
46
        // hide the lat long and zoom fields from the interface
47 7
        foreach ($this->FieldList() as $fieldToHide) {
48 7
            $fieldToHide->addExtraClass('hide');
49 7
        }
50
51 7
        $this->name = $name;
52 7
    }
53
54 3
    public function FieldHolder($properties = array())
0 ignored issues
show
Method name "LatLongField::FieldHolder" is not in camel caps format
Loading history...
55
    {
56 3
        Requirements::javascript(THIRDPARTY_DIR.'/jquery/jquery.js');
57 3
        Requirements::javascript(THIRDPARTY_DIR.'/jquery-livequery/jquery.livequery.js');
58 3
        Requirements::javascript(THIRDPARTY_DIR.'/jquery-metadata/jquery.metadata.js');
59 3
        Requirements::javascript(MAPPABLE_MODULE_PATH.'/javascript/mapField.js');
60
61
        $attributes = array(
62 3
            'class' => 'editableMap',
63 3
            'id' => 'GoogleMap',
64 3
            'data-LatFieldName' => $this->latField,
65 3
            'data-LonFieldName' => $this->longField,
66 3
            'data-ZoomFieldName' => $this->zoomField,
67 3
            'data-UseMapBounds' => false,
68 3
       );
69
70 3
        Requirements::css('mappable/css/mapField.css');
71
72
        // check for and if required add guide points
73 3
        if (!empty($this->guidePoints)) {
74 1
            $latlongps = array();
75
76 1
            foreach ($this->guidePoints as $guidepoint) {
77 1
                array_push($latlongps, $guidepoint);
78 1
            }
79
80 1
            $guidePointsJSON = json_encode($latlongps);
81
            // convert the mappable guidepoints to lat lon
82
83 1
            $attributes['data-GuidePoints'] = $guidePointsJSON;
84
85
            // we only wish to change the bounds to those of all the points iff
86
            // the item currently has no location
87 1
            $attributes['data-useMapBounds'] = true;
88 1
        }
89 3
        $content = '<div class="editableMapWrapper">'.$this->create_tag(
90 3
            'div',
91
            $attributes
92 3
       ).'</div>';
93
94 3
        $this->FieldList()->push(new LiteralField('locationEditor', $content));
95
96
        $content2 = <<<HTML
97
<div id="mapSearch">
98
<input name="location_search" id="location_search" size=80/>
99
<button class="action" id="searchLocationButton">Search Location Name</button>
100
	<div id="mapSearchResults">
101
</div>
102
</div>
103 3
HTML;
104
105 3
        $this->FieldList()->push(new LiteralField('mapSearch', $content2));
106
107 3
        return parent::FieldHolder();
108
    }
109
110
    /*
111
    Set guidance points for the map being edited.  For example in a photographic set show the map
112
    position of some other images so that subsequent photo edits do not start with a map centred
113
    at the origin
114
115
    @var newGuidePoints array of points expressed as associative arrays containing keys latitude
116
                        and longitude mapping to geographical locations
117
    */
118 1
    public function setGuidePoints($newGuidePoints)
119
    {
120 1
        $this->guidePoints = $newGuidePoints;
121 1
    }
122
123
    /**
124
     * Accessor to guidepoints.  For testing purposes.
125
     *
126
     * @return array guidepoints
127
     */
128
    public function getGuidePoints()
129
    {
130
        return $this->guidePoints;
131
    }
132
}
133