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/Kurdish.php (3 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
use OpenCafe\Tools\Leap as Leap;
5
6
return array (
7
8
  'language' =>  'ku',
9
10
  'events' => array(),
11
12
  'numbers' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
13
14
  'am_time' => 'AM',
15
16
  'pm_time' => 'PM',
17
18
  'end_of_days' => array( 'th', 'st', 'nd', 'rd' ),
19
20
21
22
/************************************************************
23
 *                        Convert to
24
 ************************************************************
25
 *
26
 * Convert algorith to convert Gregorian to Kurdish calerndar
27
 *
28
 *\_________________________________________________________/
29
 */
30
  'convert_to' => function ($date_time) {
31
32
        $jalali = include 'Jalali.php';
33
34
        $date_time = $jalali['convert_to']($date_time);
35
36
        $date_time->modify('+1321 year');
37
38
        return $date_time;
39
  },
40
41
  /************************************************************
42
   *                        Convert From
43
   ************************************************************
44
   *
45
   * Convert algorith to convert Kurdish to Gregorian calerndar
46
   *
47
   *\_________________________________________________________/
48
   */
49
  'convert_from' => function ($date_time) {
50
51
    $jalali = include 'Jalali.php';
52
53
    $date_time->modify('-1321 year');
54
55
    $date_time = $jalali['convert_from']($date_time);
56
57
    return $date_time;
58
59
60
  },
61
62
  /************************************************************
63
   *               Shorthand for kurdish calendar
64
   ************************************************************
65
   *
66
   * Kurdish calendar shorthand
67
   *
68
   *\_________________________________________________________/
69
   */
70
  'shorthand' => 'ku',
71
72
  /************************************************************
73
   *                        Month's name
74
   ************************************************************
75
   *
76
   * Jalali month name
77
   *
78
   *\_________________________________________________________/
79
   */
80
  'month' => array (
81
82
    'Xakelêw',
83
84
    'Gulan',
85
86
    'Cozerdan',
87
88
    'PuÅŸper',
89
90
    'Gelawêj',
91
92
    'Xermanan',
93
94
    'Rezber',
95
96
    'Gelarêzan',
97
98
    'Sermawez',
99
100
    'Befranbar',
101
102
    'Rêbendan',
103
104
    'ReÅŸeme'
105
106
    ),
107
108
  /************************************************************
109
   *                        Days of Week
110
   ************************************************************
111
   *
112
   * Here is week days on kurdish calendar, offset 0 is first
113
   * day of week and offset 6 is the last one.
114
   *
115
   *\_________________________________________________________/
116
   */
117
118
119
  'days_of_week' => array (
120
121
     'YekÅŸeme',
122
     'Dúşeme',
123
     'Séşeme',
124
     'Çúwarşeme',
125
     'Péncşeme',
126
     'Heyní',
127
     'Åžeme',
128
129
  ),
130
131
  'start_day_of_week' => 'Åžeme',
132
133
  'month_days_number' => array(      1 => 31,
134
                                     2 => 31,
135
                                     3 => 31,
136
                                     4 => 31,
137
                                     5 => 31,
138
                                     6 => 31,
139
                                     7 => 30,
140
                                     8 => 30,
141
                                     9 => 30,
142
                                     10 => 30,
143
                                     11 => 30,
144
                                     12 => 29 ),
145
146
  /************************************************************
147
  *                      Day of year
148
  ************************************************************
149
  *
150
  *  Return days of year on Kurdish cleander
151
  *
152
  *\_________________________________________________________/
153
  */
154 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...
155
156
    $result = null;
157
158
    $config = include 'Kurdish.php';
159
160
    $month = $date_time->format('n');
161
162
    $day = $date_time->format('d');
163
164
    foreach ($config[ 'month_days_number' ] as $_month => $value) {
165
        if ($_month < $month) {
166
            $result += $value;
167
        }
168
    }
169
170
    $result += $day;
171
172
    return $result;
173
174
  },
175
176
  /************************************************************
177
   *                       Day of Week
178
   ************************************************************
179
   *
180
   *  Return day of week on Kurdish cleander
181
   *  example : Yekshanbe = result is 2
182
   *\_________________________________________________________/
183
  */
184 View Code Duplication
  'day_of_week' => function ($date_tim, $day_of_week) {
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...
185
186
      $days_of_week = array(
187
          'Dúşeme',
188
          'Séşeme',
189
          'Çúwarşeme',
190
          'Péncşeme',
191
          'Heyní',
192
          'Åžeme',
193
          'YekÅŸeme',
194
      );
195
196
      $days = array(
197
          1 => 'Åžeme',
198
          2 => 'YekÅŸeme',
199
          3 => 'Dúşeme',
200
          4 => 'Séşeme',
201
          5 => 'Çúwarşeme',
202
          6 => 'Péncşeme',
203
          7 => 'Heyní'
204
      );
205
206
        $configGregorian = include 'Gregorian.php';
207
208
        $day = str_replace(
209
            $configGregorian[ 'days_of_week' ],
210
            $days_of_week,
211
            $day_of_week
212
        );
213
214
        foreach ($days as $key => $value) {
215
            if ($day == $value) {
216
               return $key;
217
            }
218
        }
219
220
  },
221
222
  /************************************************************
223
   *                       Leap year
224
   ************************************************************
225
   *
226
   * Leap Year formula on Kurdish calendar
227
   *
228
   *\_________________________________________________________/
229
   */
230 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...
231
232
     $a = 0.025;
233
234
     $b = 266;
235
236
    if ($year > 0) {
237
        $leapDays0 = (($year + 38) % 2820)*0.24219 + $a;
238
        // 0.24219 ~ extra days of one year
239
        $leapDays1 = (($year + 39) % 2820)*0.24219 + $a;
240
        // 38 days is the difference of epoch to 2820-year cycle
241
    } elseif ($year < 0) {
242
        $leapDays0 = (($year + 39) % 2820)*0.24219 + $a;
243
        $leapDays1 = (($year + 40) % 2820)*0.24219 + $a;
244
    } else {
245
        return false;
246
    }
247
248
     $frac0 = intval(($leapDays0 - intval($leapDays0))*1000);
249
     $frac1 = intval(($leapDays1 - intval($leapDays1))*1000);
250
251
    if ($frac0 <= $b && $frac1 > $b) {
252
        return true;
253
    } else {
254
        return false;
255
    }
256
257
  },
258
259
  /************************************************************
260
   *                        Weekend
261
   ************************************************************
262
   *
263
   * Kurdish weekend
264
   *
265
   *\_________________________________________________________/
266
   */
267
  'weekend' => array( 'friday' )
268
269
 );
270