Issues (34)

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/Mapping/NameMapping.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
/*
4
 * This file is part of the Runalyze Device List.
5
 *
6
 * (c) RUNALYZE <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Runalyze\Devices\Mapping;
13
14
use Runalyze\Devices\Device\DeviceProfile;
15
16
class NameMapping
17
{
18
    /** @var int[]|string[] */
19
    protected $Mapping = [];
20
21
    /**
22
     * @return array
23
     */
24 1
    protected function getMapping()
25
    {
26
        return [
27 1
            'neorun' => DeviceProfile::APP_EPSON_NEO_RUN,
28
            'kompass' => DeviceProfile::APP_KOMPASS,
29
            'runtastic' => DeviceProfile::APP_RUNTASTIC,
30
            'smashrun' => DeviceProfile::APP_SMASHRUN,
31
            'trails' => DeviceProfile::APP_TRAILS,
32
            'sports tracker' => DeviceProfile::APP_SPORTS_TRACKER,
33
            'runkeeper' => DeviceProfile::APP_RUNKEEPER,
34
            'runmeter' => DeviceProfile::APP_RUNMETER,
35
            'decathlon' => DeviceProfile::APP_DECATHLON_COACH,
36
            'endomondo' => DeviceProfile::APP_ENDOMONDO,
37
            'ismoothrun' => DeviceProfile::APP_I_SMOOTH_RUN,
38
            'strava' => DeviceProfile::APP_STRAVA,
39
            'trailrunner' => DeviceProfile::APP_TRAIL_RUNNER,
40
            'run.gps' => DeviceProfile::APP_RUN_GPS_TRAINER,
41
            'osmand' => DeviceProfile::APP_OSM_AND,
42
            'locus map' => DeviceProfile::APP_LOCUS_MAP,
43
            'endomondo' => DeviceProfile::APP_ENDOMONDO,
44
            'runnerup' => DeviceProfile::APP_RUNNERUP,
45
            'polar flow' => DeviceProfile::APP_POLAR_FLOW,
46
            'sportractive' => DeviceProfile::APP_SPORTRACTIVE,
47
            'oruxmaps' => DeviceProfile::APP_ORUX_MAPS,
48
            'komoot' => DeviceProfile::APP_KOMOOT,
49
            'navime' => DeviceProfile::APP_NAVIME,
50
            'http://www.polarpersonaltrainer.com' => DeviceProfile::APP_POLAR_PERSONAL_TRAINER,
51
            'a-rival' => DeviceProfile::ARIVAL_UNKNOWN,
52
            'rungap' => DeviceProfile::APP_RUN_GAP,
53
            'globalsat' => DeviceProfile::APP_GLOBAL_SAT,
54
            'the sufferfest training system' => DeviceProfile::APP_THE_SUFFERFEST,
55
            'garmin connect' => DeviceProfile::APP_GARMIN_CONNECT,
56
            'outdooractive' => DeviceProfile::APP_OUTDOOR_ACTIVE,
57
            'etrex 30x' => DeviceProfile::GARMIN_ETREX_30_X,
58
            'polar vantage m' => DeviceProfile::POLAR_VANTAGE_M,
59
            'polar vantage v2' => DeviceProfile::POLAR_VANTAGE_V_2,
60
            'polar vantage v' => DeviceProfile::POLAR_VANTAGE_V,
61
            'polar a370' => DeviceProfile::POLAR_A_370,
62
            'polar m200' => DeviceProfile::POLAR_M_200,
63
            'polar m400' => DeviceProfile::POLAR_M_400,
64
            'polar m430' => DeviceProfile::POLAR_M_430,
65
            'polar m450' => DeviceProfile::POLAR_M_450,
66
            'polar m460' => DeviceProfile::POLAR_M_460,
67
            'polar m600' => DeviceProfile::POLAR_M_600,
68
            'polar v650' => DeviceProfile::POLAR_V_650,
69
            'polar v800' => DeviceProfile::POLAR_V_800,
70
            'polar ignite' => DeviceProfile::POLAR_IGNITE,
71
            'polar grit x' => DeviceProfile::POLAR_GRIT_X,
72
            'fitbit ionic' => DeviceProfile::FITBIT_IONIC,
73
            'fitbit surge' => DeviceProfile::FITBIT_SURGE,
74
            'fitbit versa' => DeviceProfile::FITBIT_VERSA,
75
            'fitbit charge 2' => DeviceProfile::FITBIT_CHARGE_2,
76
            'fēnix 3' => DeviceProfile::GARMIN_FENIX_3,
77
            'fēnix 3 hr' => DeviceProfile::GARMIN_FENIX_3_H_R,
78
            'forerunner 235' => DeviceProfile::GARMIN_FORERUNNER_235,
79
            'forereunner305' => DeviceProfile::GARMIN_FORERUNNER_305,
80
            'forereunner 310xt' => DeviceProfile::GARMIN_FORERUNNER_310_X_T,
81
            'forereunner 405' => DeviceProfile::GARMIN_FORERUNNER_405,
82
            'forereunner 410' => DeviceProfile::GARMIN_FORERUNNER_410,
83
            'forereunner 735xt' => DeviceProfile::GARMIN_FORERUNNER_735_X_T,
84
            'forereunner 935' => DeviceProfile::GARMIN_FORERUNNER_935,
85
            'forereunner 945' => DeviceProfile::GARMIN_FORERUNNER_945,
86
            'fenix 6 sapphire' => DeviceProfile::GARMIN_FENIX_6,
87
            'garmin forereunner 610' => DeviceProfile::GARMIN_FORERUNNER_610,
88
            'garmin forerunner 245' => DeviceProfile::GARMIN_FORERUNNER_245,
89
            'garmin forerunner 735xt' => DeviceProfile::GARMIN_FORERUNNER_735_X_T,
90 1
            'garmin forerunner 935' => DeviceProfile::GARMIN_FORERUNNER_935,
91
            'garmin venu sq' => DeviceProfile::GARMIN_VENU_SQ,
92 1
            'fr15' => DeviceProfile::GARMIN_FORERUNNER_15,
93 1
            'oregon 600' => DeviceProfile::GARMIN_OREGON_600,
94
            'oregon 700' => DeviceProfile::GARMIN_OREGON_700,
95
            'suunto ambit2' => DeviceProfile::SUUNTO_AMBIT_2,
96
            'suunto ambit2 r' => DeviceProfile::SUUNTO_AMBIT_2_R,
97
            'suunto ambit2 s' => DeviceProfile::SUUNTO_AMBIT_2_S,
98
            'relive' => DeviceProfile::APP_RELIVE,
99 1
            'gpsmap 64s' => DeviceProfile::GARMIN_GPSMAP_64_S,
100
            'gpsmap 64st' => DeviceProfile::GARMIN_GPSMAP_64_S_T,
101 1
            'gpsmap 65s' => DeviceProfile::GARMIN_GPSMAP_65_S,
102 1
            'gpsmap 66i' => DeviceProfile::GARMIN_GPSMAP_66_I,
103 1
            'gpsmap 66S' => DeviceProfile::GARMIN_GPSMAP_66_S,
104
            'gpsmap 66sr' => DeviceProfile::GARMIN_GPSMAP_66_S_R,
105
            'gpsmap66' => DeviceProfile::GARMIN_GPSMAP_66,
106
            'huami amazfit pace' => DeviceProfile::HUAMI_AMAZFIT_PACE,
107 1
            'etrex 30' => DeviceProfile::GARMIN_ETREX_30,
108
            'etrex 30x' => DeviceProfile::GARMIN_ETREX_30_X,
109
            'epix' => DeviceProfile::GARMIN_EPIX,
110
            'bkool' => DeviceProfile::APP_BKOOL,
111
            'coros wearables' => DeviceProfile::COROS_UNKNOWN,
112
            'bryton' => DeviceProfile::BRYTON_UNKNOWN,
113
            'suunto ambit3 peak' => DeviceProfile::SUUNTO_AMBIT_3_PEAK,
114
            'stryd' => DeviceProfile::STRYD_UNKNOWN,
115
            'ghostracer' => DeviceProfile::APP_GHOSTRACER,
116
        ];
117
    }
118
119
    public function __construct()
120
    {
121
        $this->Mapping = $this->getMapping();
122
    }
123
124
    /**
125
     * @param  int|string $creator
126
     * @return int|string
127
     */
128
    public function toInternal($creator)
129
    {
130
        foreach ($this->Mapping as $startsWith => $id) {
131
            if (strtolower(substr($creator, 0, strlen($startsWith))) === $startsWith) {
0 ignored issues
show
Unused Code Bug introduced by
The strict comparison === seems to always evaluate to false as the types of strtolower(substr($creat..., strlen($startsWith))) (string) and $startsWith (integer) can never be identical. Maybe you want to use a loose comparison == instead?
Loading history...
132
                return $id;
133
            }
134
        }
135
136
        return;
137
    }
138
}
139