Issues (64)

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/CalendarSettings/Julian.php (5 issues)

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
 use OpenCafe\Datium as Datium;
4
5
 return [
6
7
 'numbers' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
8
9
 'am_time' => 'AM',
10
11
 'pm_time' => 'PM',
12
13
 'end_of_days' => array( 'th', 'st', 'nd', 'rd' ),
14
15
16
17
 /************************************************************
18
  *                        Convert to
19
  ************************************************************
20
  *
21
  * Convert algorith to convert Gregorian to Julian calerndar
22
  *
23
  *\_________________________________________________________/
24
  */
25 View Code Duplication
   'convert_to' => function ($date_time) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
27
     $year = $date_time->format('Y');
28
29
     $month = $date_time->format('m');
30
31
     $day = $date_time->format('d');
32
33
     $jd = gregoriantojd($month, $day, $year);
34
35
     $date = explode('/', jdtojulian( $jd ));
36
37
     $date_time->setDate($date[2], $date[0], $date[1]);
38
39
     return $date_time;
40
41
   },
42
43
    /************************************************************
44
    *                        Convert From
45
    ************************************************************
46
    *
47
    * Convert algorith to convert Julian to Gregorian calerndar
48
    *
49
    *\_________________________________________________________/
50
    */
51 View Code Duplication
    'convert_from' => function ($date_time) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
52
53
      $year = $date_time->format('Y');
54
55
      $month = $date_time->format('m');
56
57
      $day = $date_time->format('d');
58
59
      $date = juliantojd( $month, $day, $year );
60
61
      $date = explode('/', JDToGregorian( $date ) );
62
63
      $date_time->setDate($date[2], $date[0], $date[1]);
64
65
      return $date_time;
66
67
    },
68
69
    /************************************************************
70
    *               Shorthand for Julian calendar
71
    ************************************************************
72
    *
73
    * Julian calendar shorthand
74
    *
75
    *\_________________________________________________________/
76
    */
77
    'shorthand' => 'ju',
78
79
    /************************************************************
80
    *                        Month's name
81
    ************************************************************
82
    *
83
    * Julian month name
84
    *
85
    *\_________________________________________________________/
86
    */
87
    'month' => array(
88
89
      'January',
90
91
      'February',
92
93
      'March',
94
95
      'April',
96
97
      'May',
98
99
      'June',
100
101
      'July',
102
103
      'August',
104
105
      'September',
106
107
      'October',
108
109
      'November',
110
111
      'December'
112
113
     ),
114
115
    /************************************************************
116
    *                        Days of Week
117
    ************************************************************
118
    *
119
    * Here is week days on Julian calendar, offset 0 is first
120
    * day of week and offset 6 is the last one.
121
    *
122
    *\_________________________________________________________/
123
    */
124
    'days_of_week' => array (
125
126
       'Monday',
127
       'Tuesday',
128
       'Wednesday',
129
       'Thursday',
130
       'Friday',
131
       'Saturday',
132
       'Sunday',
133
    ),
134
135
136
    'month_days_number' => array(  1 => 31,
137
                                   2 => 28,
138
                                   3 => 31,
139
                                   4 => 30,
140
                                   5 => 31,
141
                                   6 => 30,
142
                                   7 => 31,
143
                                   8 => 31,
144
                                   9 => 30,
145
                                   10 => 31,
146
                                   11 => 30,
147
                                   12 => 30 ),
148
149
150 View Code Duplication
    'day_of_year' => function ($date_time) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
151
152
        $result = null;
153
154
        $_month = null;
155
156
        $config = include 'Julian.php';
157
158
        $month = $date_time->format('n');
159
160
        $day = $date_time->format('d');
161
162
        foreach ($config['month_days_number'] as $_month => $value) {
163
            if ($_month < $month) {
164
                $result += $value;
165
            }
166
        }
167
168
        $result += $day;
169
170
        return $result;
171
172
    },
173
174 View Code Duplication
    'day_of_week' => function ($date_time) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
175
176
        $config = include 'Julian.php';
177
178
        $day = $date_time->format('l');
179
180
        foreach ($config['days_of_week'] as $key => $value) {
181
            if ($value == $day) {
182
                return $key += 1;
183
            }
184
        }
185
186
    },
187
188
    /************************************************************
189
    *                       Leap year
190
    ************************************************************
191
    *
192
    * Leap Year formula on Julian calendar
193
    *
194
    *\_________________________________________________________/
195
    */
196 View Code Duplication
    'leap_year' => function ($year) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
197
198
        return ( ( ( $year % 4 ) == 0 ) && ( ( ( $year % 100 ) != 0 ) || ( ( $year % 400 ) == 0 ) ) );
199
200
    },
201
202
    /************************************************************
203
    *                        Weekend
204
    ************************************************************
205
    *
206
    * Julian weekend
207
    *
208
    *\_________________________________________________________/
209
    */
210
    'weekend' => array( 'saturday', 'sunday' ),
211
212
  ];
213