Passed
Pull Request — master (#322)
by Mirko
08:41
created
htdocs/lib2/rowEditor.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 {
10 10
     public $sTable;
11 11
     public $sAutoIncrementField = null;
12
-    public $pk;     // (idx:name; type, default, nullable, value, insertfunction)
12
+    public $pk; // (idx:name; type, default, nullable, value, insertfunction)
13 13
     public $fields; // (idx:name; type, default, nullable, value, changed, insertfunction)
14 14
 
15 15
     // status var
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             if ($i == $index) {
255 255
                 return $k;
256 256
             }
257
-            $i ++;
257
+            $i++;
258 258
         }
259 259
     }
260 260
 
Please login to merge, or discard this patch.
htdocs/lib2/logic/logpics.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@
 block discarded – undo
17 17
     const FOR_STARTPAGE_GALLERY = 1;
18 18
     const FOR_NEWPICS_GALLERY = 2;
19 19
     const FOR_USER_STAT = 3;
20
-    const FOR_USER_GALLERY = 4;   // params: userid
20
+    const FOR_USER_GALLERY = 4; // params: userid
21 21
     const FOR_MYHOME_GALLERY = 5;
22
-    const FOR_CACHE_STAT = 6;     // params: cacheid
23
-    const FOR_CACHE_GALLERY = 7;  // params: cacheid
22
+    const FOR_CACHE_STAT = 6; // params: cacheid
23
+    const FOR_CACHE_GALLERY = 7; // params: cacheid
24 24
 
25
-    const MAX_PICTURES_PER_GALLERY_PAGE = 48;   // must be multiple of 6
25
+    const MAX_PICTURES_PER_GALLERY_PAGE = 48; // must be multiple of 6
26 26
 
27 27
 
28 28
     public static function get($purpose, $userid = 0, $cacheid = 0)
Please login to merge, or discard this patch.
htdocs/lib2/logic/logtypes.inc.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -91,28 +91,28 @@  discard block
 block discarded – undo
91 91
 
92 92
     $allowed_logtypes = array();
93 93
     if ($owner || $admin_report || $admin_locked) {
94
-        $allowed_logtypes[] = 3;   // note
94
+        $allowed_logtypes[] = 3; // note
95 95
     }
96 96
     if (($owner && $statuslogs) || $admin_report) {
97 97
         if ($cache_status != 5 && (($cache_status != 4 && $cache_status != 7) || $admin_report)) {
98
-            $allowed_logtypes[] = 10;  // ready for search
99
-            $allowed_logtypes[] = 11;  // temporarily not available
100
-            $allowed_logtypes[] = 9;   // archived
101
-            $allowed_logtypes[] = 13;  // locked
98
+            $allowed_logtypes[] = 10; // ready for search
99
+            $allowed_logtypes[] = 11; // temporarily not available
100
+            $allowed_logtypes[] = 9; // archived
101
+            $allowed_logtypes[] = 13; // locked
102 102
         }
103 103
         if ($admin_report || $old_logtype == 14) {
104 104
             $allowed_logtypes[] = 14;
105 105
         }  // locked, invisible
106 106
     }
107 107
     if ($cache_type == 6) { // event
108
-        $allowed_logtypes[] = 8;   // will attend
109
-        $allowed_logtypes[] = 7;   // attended
108
+        $allowed_logtypes[] = 8; // will attend
109
+        $allowed_logtypes[] = 7; // attended
110 110
     } else {
111
-        $allowed_logtypes[] = 1;   // found
112
-        $allowed_logtypes[] = 2;   // not found
111
+        $allowed_logtypes[] = 1; // found
112
+        $allowed_logtypes[] = 2; // not found
113 113
     }
114 114
     if (!($owner || $admin_report || $admin_locked)) {
115
-        $allowed_logtypes[] = 3;   // note
115
+        $allowed_logtypes[] = 3; // note
116 116
     }
117 117
 
118 118
     // always allow to keep the existing logtype when the log is edited by an admin
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             } elseif (!$opt['logic']['admin']['team_comments_only_for_reports'] || admin_has_open_report($cache_id)) {
152 152
                 // allowed for report processing by admins
153 153
                 $allowed = true;
154
-            } elseif ($login->hasAdminPriv(ADMIN_USER) && in_array($rCache['status'], [6,7])) {
154
+            } elseif ($login->hasAdminPriv(ADMIN_USER) && in_array($rCache['status'], [6, 7])) {
155 155
                 // allowed for admins && locked caches, see http://forum.opencaching.de/index.php?topic=3102.msg39517#msg39517
156 156
                 $allowed = true;
157 157
             } else {
Please login to merge, or discard this patch.
htdocs/lib2/logic/const.inc.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
 define('RE_TYPE_FLOAT', 5);
17 17
 define('RE_TYPE_DOUBLE', 6);
18 18
 
19
-define('RE_INSERT_NOTHING', 0);       //
20
-define('RE_INSERT_OVERWRITE', 1);     // ignore given values and use function
21
-define('RE_INSERT_IGNORE', 2);        // dont use this column on insert
19
+define('RE_INSERT_NOTHING', 0); //
20
+define('RE_INSERT_OVERWRITE', 1); // ignore given values and use function
21
+define('RE_INSERT_IGNORE', 2); // dont use this column on insert
22 22
 define('RE_INSERT_AUTOINCREMENT', 4); // column is an auto increment column
23
-define('RE_INSERT_AUTOUUID', 8);      // if empty, UUID is generated by before insert trigger (not supported for primary key fields)
24
-define('RE_INSERT_NOW', 16);          // NOW()
23
+define('RE_INSERT_AUTOUUID', 8); // if empty, UUID is generated by before insert trigger (not supported for primary key fields)
24
+define('RE_INSERT_NOW', 16); // NOW()
25 25
 
26 26
 define('EUROPEAN_LETTERS', 'A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ');
27 27
 // ASCII + ISO-8859-1 0xC0..0xFF
@@ -31,13 +31,13 @@  discard block
 block discarded – undo
31 31
 define('REGEX_FIRST_NAME', REGEX_LAST_NAME);
32 32
 define('REGEX_STATPIC_TEXT', '^[' . EUROPEAN_LETTERS . '0-9\.\-_ @=)(\/\\\&*\$+~#!§%;,-?:\[\]{}¹²³\'\"`\|µ°\%]{0,30}$');
33 33
 
34
-define('ADMIN_TRANSLATE', 1);     // edit translation
35
-define('ADMIN_MAINTAINANCE', 2);  // check table etc.
36
-define('ADMIN_USER', 4);          // drop users, caches etc.
37
-define('ADMIN_NEWS', 8);          // obsolete / reserved
38
-define('ADMIN_RESTORE', 16);      // restore vandalized listings
39
-define('ADMIN_ROOT', 128 | 127);  // root + all previous rights
40
-define('ADMIN_LISTING', 1024);    // can edit any cache listings
34
+define('ADMIN_TRANSLATE', 1); // edit translation
35
+define('ADMIN_MAINTAINANCE', 2); // check table etc.
36
+define('ADMIN_USER', 4); // drop users, caches etc.
37
+define('ADMIN_NEWS', 8); // obsolete / reserved
38
+define('ADMIN_RESTORE', 16); // restore vandalized listings
39
+define('ADMIN_ROOT', 128 | 127); // root + all previous rights
40
+define('ADMIN_LISTING', 1024); // can edit any cache listings
41 41
 
42 42
 define('ATTRIB_SELECTED', 1);
43 43
 define('ATTRIB_UNSELECTED', 2);
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
 // ID 15 was temporarily used and is reserved, see commit dda7ef0. Continue with 16.
80 80
 
81 81
 // user.data_license values
82
-define('OLD_DATA_LICSENSE', 0);                       // before deadline
83
-define('NEW_DATA_LICENSE_ACTIVELY_DECLINED', 1);      // declined license
84
-define('NEW_DATA_LICENSE_ACTIVELY_ACCEPTED', 2);      // accepted new license on registration
85
-define('NEW_DATA_LICENSE_PASSIVELY_ACCEPTED', 3);     // did not decline license until deadline
86
-define('NEW_DATA_LICENSE_PASSIVELY_DECLINED', 4);     // could not accept/decline because disabled
82
+define('OLD_DATA_LICSENSE', 0); // before deadline
83
+define('NEW_DATA_LICENSE_ACTIVELY_DECLINED', 1); // declined license
84
+define('NEW_DATA_LICENSE_ACTIVELY_ACCEPTED', 2); // accepted new license on registration
85
+define('NEW_DATA_LICENSE_PASSIVELY_ACCEPTED', 3); // did not decline license until deadline
86
+define('NEW_DATA_LICENSE_PASSIVELY_DECLINED', 4); // could not accept/decline because disabled
87 87
 
88 88
 //picture upload/resize parameters
89 89
 define('PICTURE_QUALITY', 85);
Please login to merge, or discard this patch.
htdocs/lib2/logic/cacheIcon.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
     public static function get($user_id, $cache_id, $cache_status, $cache_userid, $iconname)
12 12
     {
13
-        $iconname = mb_eregi_replace("cache/", "", $iconname);   // for old cache_type table contents
13
+        $iconname = mb_eregi_replace("cache/", "", $iconname); // for old cache_type table contents
14 14
         $iconext = "." . mb_eregi_replace("^.*\.", "", $iconname);
15 15
         $iconname = mb_eregi_replace("\..*", "", $iconname);
16 16
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
                 break;
31 31
             case 5:
32 32
                 $iconname .= "-s";
33
-                break;      // fix for RT ticket #3403
33
+                break; // fix for RT ticket #3403
34 34
             case 6:
35 35
                 $iconname .= "-a";
36 36
                 break;
Please login to merge, or discard this patch.
htdocs/lib2/logic/sitemapxml.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 {
13 13
     public $sDefaultChangeFreq = 'monthly';
14 14
     public $nMaxFileSize = 9961472; // max file size, 10MB by specification
15
-    public $nMaxUrlCount = 50000;   // max number of URLs per file, 50000 by specification
15
+    public $nMaxUrlCount = 50000; // max number of URLs per file, 50000 by specification
16 16
 
17 17
     public $sPath = '';
18 18
     public $sDomain = '';
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
         // open new XML file?
77 77
         if ($this->oSitemapFile === false) {
78
-            $this->nSitemapIndex ++;
78
+            $this->nSitemapIndex++;
79 79
             $sFilename = 'sitemap-' . $this->nSitemapIndex . '.xml.gz';
80 80
             $this->oSitemapFile = gzopen($this->sPath . $sFilename, 'wb');
81 81
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         // write string to XML
92 92
         gzwrite($this->oSitemapFile, $str);
93 93
         $this->nWrittenSize += strlen($str);
94
-        $this->nWrittenCount ++;
94
+        $this->nWrittenCount++;
95 95
     }
96 96
 
97 97
     public function close()
Please login to merge, or discard this patch.
htdocs/lib2/logic/coordinate.class.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
                 0
176 176
             ];
177 177
         }
178
-        $lw = (float) $this->nLon;
179
-        $bw = (float) $this->nLat;
178
+        $lw = (float)$this->nLon;
179
+        $bw = (float)$this->nLat;
180 180
 
181 181
         //WGS84 Datum
182 182
         //Große Halbachse a und Abplattung f
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
 
196 196
         //Koeffizienten zur Berechnung der Meridianbogenlänge
197 197
         $e0 = $c * (pi() / 180) * (1 - 3 * $ex2 / 4 + 45 * $ex4 / 64 - 175 * $ex6 / 256 + 11025 * $ex8 / 16384);
198
-        $e2 = $c * (- 3 * $ex2 / 8 + 15 * $ex4 / 32 - 525 * $ex6 / 1024 + 2205 * $ex8 / 4096);
198
+        $e2 = $c * (-3 * $ex2 / 8 + 15 * $ex4 / 32 - 525 * $ex6 / 1024 + 2205 * $ex8 / 4096);
199 199
         $e4 = $c * (15 * $ex4 / 256 - 105 * $ex6 / 1024 + 2205 * $ex8 / 16384);
200
-        $e6 = $c * (- 35 * $ex6 / 3072 + 315 * $ex8 / 12288);
200
+        $e6 = $c * (-35 * $ex6 / 3072 + 315 * $ex8 / 12288);
201 201
 
202 202
         //Längenzone lz und Breitenzone (Band) bz
203 203
         $lzn = intval(($lw + 180) / 6) + 1;
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
         if ($lzn < 10) {
224 224
             $lz = "0" . $lzn;
225 225
         }
226
-        $bd = (int) (1 + ($bw + 80) / 8);
226
+        $bd = (int)(1 + ($bw + 80) / 8);
227 227
         $bz = substr($b_sel, $bd - 1, 1);
228 228
 
229 229
         //Geographische Breite in Radianten br
@@ -268,20 +268,20 @@  discard block
 block discarded – undo
268 268
         $ew = 0.9996 * ($nd * $cos1 * $dl + $nd * $cos3 * (1 - $tan2 + $etasq) * $dl3 / 6 +
269 269
                 $nd * $cos5 * (5 - 18 * $tan2 + $tan4) * $dl5 / 120) + 500000;
270 270
 
271
-        $nk = $nw - (int) $nw;
271
+        $nk = $nw - (int)$nw;
272 272
         if ($nk < 0.5) {
273
-            $nw = '' . (int) $nw;
273
+            $nw = '' . (int)$nw;
274 274
         } else {
275
-            $nw = '' . ((int) $nw + 1);
275
+            $nw = '' . ((int)$nw + 1);
276 276
         }
277 277
 
278 278
         while (strlen($nw) < 7) {
279 279
             $nw = '0' . $nw;
280 280
         }
281 281
 
282
-        $nk = $ew - (int) $ew;
282
+        $nk = $ew - (int)$ew;
283 283
         if ($nk < 0.5) {
284
-            $ew = '0' . (int) $ew;
284
+            $ew = '0' . (int)$ew;
285 285
         } else {
286 286
             $ew = '0' . intval($ew + 1);
287 287
         }
@@ -331,8 +331,8 @@  discard block
 block discarded – undo
331 331
                 0
332 332
             ];
333 333
         }
334
-        $lw = (float) $lw;
335
-        $bw = (float) $bw;
334
+        $lw = (float)$lw;
335
+        $bw = (float)$bw;
336 336
 
337 337
         // Quellsystem WGS 84 Datum
338 338
         // Große Halbachse a und Abplattung fq
@@ -410,8 +410,8 @@  discard block
 block discarded – undo
410 410
                 0
411 411
             ];
412 412
         }
413
-        $lp = (float) $lp;
414
-        $bp = (float) $bp;
413
+        $lp = (float)$lp;
414
+        $bp = (float)$bp;
415 415
 
416 416
         // Potsdam Datum
417 417
         // Große Halbachse a und Abplattung f
@@ -429,9 +429,9 @@  discard block
 block discarded – undo
429 429
 
430 430
         // Koeffizienten zur Berechnung der Meridianbogenlänge
431 431
         $e0 = $c * (pi() / 180) * (1 - 3 * $ex2 / 4 + 45 * $ex4 / 64 - 175 * $ex6 / 256 + 11025 * $ex8 / 16384);
432
-        $e2 = $c * (- 3 * $ex2 / 8 + 15 * $ex4 / 32 - 525 * $ex6 / 1024 + 2205 * $ex8 / 4096);
432
+        $e2 = $c * (-3 * $ex2 / 8 + 15 * $ex4 / 32 - 525 * $ex6 / 1024 + 2205 * $ex8 / 4096);
433 433
         $e4 = $c * (15 * $ex4 / 256 - 105 * $ex6 / 1024 + 2205 * $ex8 / 16384);
434
-        $e6 = $c * (- 35 * $ex6 / 3072 + 315 * $ex8 / 12288);
434
+        $e6 = $c * (-35 * $ex6 / 3072 + 315 * $ex8 / 12288);
435 435
 
436 436
         // Breite in Radianten
437 437
         $br = $bp * pi() / 180;
@@ -469,18 +469,18 @@  discard block
 block discarded – undo
469 469
         $rw = ($nd * $cos1 * $dl + $nd * $cos3 * (1 - $tan2 + $etasq) * $dl3 / 6 +
470 470
             $nd * $cos5 * (5 - 18 * $tan2 + $tan4) * $dl5 / 120 + $kz * 1e6 + 500000);
471 471
 
472
-        $nk = $hw - (int) $hw;
472
+        $nk = $hw - (int)$hw;
473 473
         if ($nk < 0.5) {
474
-            $hw = (int) $hw;
474
+            $hw = (int)$hw;
475 475
         } else {
476
-            $hw = ((int) $hw) + 1;
476
+            $hw = ((int)$hw) + 1;
477 477
         }
478 478
 
479
-        $nk = $rw - (int) $rw;
479
+        $nk = $rw - (int)$rw;
480 480
         if ($nk < 0.5) {
481
-            $rw = (int) $rw;
481
+            $rw = (int)$rw;
482 482
         } else {
483
-            $rw = (int) ($rw + 1);
483
+            $rw = (int)($rw + 1);
484 484
         }
485 485
 
486 486
         return [
@@ -499,8 +499,8 @@  discard block
 block discarded – undo
499 499
         $lat_base = 52.15517440;
500 500
         $lon_base = 5.38720621;
501 501
 
502
-        for ($i = 0; $i <= 6; $i ++) {
503
-            for ($j = 0; $j <= 5; $j ++) {
502
+        for ($i = 0; $i <= 6; $i++) {
503
+            for ($j = 0; $j <= 5; $j++) {
504 504
                 $rpq[$i][$j] = 0;
505 505
                 $spq[$i][$j] = 0;
506 506
             }
@@ -535,8 +535,8 @@  discard block
 block discarded – undo
535 535
         $xOrigin = 0;
536 536
         $yOrigin = 0;
537 537
 
538
-        for ($q = 0; $q <= 5; $q ++) {
539
-            for ($p = 0; $p <= 6; $p ++) {
538
+        for ($q = 0; $q <= 5; $q++) {
539
+            for ($p = 0; $p <= 6; $p++) {
540 540
                 $xOrigin = $xOrigin + ($rpq[$p][$q] * ((pow($dlat, $p)) * (pow($dlon, $q))));
541 541
                 $yOrigin = $yOrigin + ($spq[$p][$q] * ((pow($dlat, $p)) * (pow($dlon, $q))));
542 542
             }
Please login to merge, or discard this patch.
htdocs/lib2/logic/picture.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -435,9 +435,9 @@
 block discarded – undo
435 435
                 return false;
436 436
             } else {
437 437
                 // restore picture file
438
-                $this->setUrl($original_url);        // set the url, so that we can
439
-                $filename = $this->getFilename();    // .. retreive the file path+name
440
-                $this->setFilenames($filename);      // now set url(s) from the new uuid
438
+                $this->setUrl($original_url); // set the url, so that we can
439
+                $filename = $this->getFilename(); // .. retreive the file path+name
440
+                $this->setFilenames($filename); // now set url(s) from the new uuid
441 441
                 @rename($this->deleted_filename($filename), $this->getFilename());
442 442
             }
443 443
         }
Please login to merge, or discard this patch.
htdocs/lib2/logic/cachelog.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -355,7 +355,7 @@
 block discarded – undo
355 355
         //     return array();
356 356
         // Logic Error - log types are still valid when no NEW logs are allowed for the cache.
357 357
         // (Would e.g. block admin logs and log-type restoring for locked caches.)
358
-        return get_cache_log_types($this->getCacheId(), $this->getType());  // depends on userid
358
+        return get_cache_log_types($this->getCacheId(), $this->getType()); // depends on userid
359 359
     }
360 360
 
361 361
     public static function isDuplicate($cacheId, $userId, $logType, $logDate, $logText)
Please login to merge, or discard this patch.