Completed
Pull Request — master (#300)
by
unknown
07:10
created
htdocs/lib2/logic/data-license.inc.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
             $ltext = "© ";
56 56
             if ($html) {
57
-                $ltext .= "<a href='" . $server_address . "viewprofile.php?userid=" . $userid . "' target='_blank'>";
57
+                $ltext .= "<a href='".$server_address."viewprofile.php?userid=".$userid."' target='_blank'>";
58 58
             }
59 59
             $ltext .= $username;
60 60
             if ($html) {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             }
63 63
             $ltext .= ", ";
64 64
             if ($html) {
65
-                $ltext .= "<a href='" . $server_address . "viewcache.php?cacheid=" . $cacheid . "' target='_blank'>";
65
+                $ltext .= "<a href='".$server_address."viewcache.php?cacheid=".$cacheid."' target='_blank'>";
66 66
             }
67 67
             $ltext .= $opt['page']['sitename'];
68 68
             if ($html) {
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
             }
71 71
             $ltext .= ", ";
72 72
             if ($html) {
73
-                $ltext .= "<a href='" . $lurl . "' target='_blank'>";
73
+                $ltext .= "<a href='".$lurl."' target='_blank'>";
74 74
             }
75 75
             $ltext .= "CC BY-NC-ND";
76 76
             if ($html) {
77 77
                 $ltext .= "</a>";
78 78
             }
79 79
             if ($for_cachedesc) {
80
-                $ltext .= ", " . $asof . " " . date($df);
80
+                $ltext .= ", ".$asof." ".date($df);
81 81
             }
82 82
         }
83 83
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@
 block discarded – undo
27 27
     $for_cachedesc,
28 28
     $html,
29 29
     $twolines = false
30
-) {
30
+)
31
+{
31 32
     global $opt, $translate;
32 33
 
33 34
     $ltext = "";
Please login to merge, or discard this patch.
htdocs/lib2/logic/labels.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  ***************************************************************************/
7 7
 
8 8
 // try to include cache file
9
-if (!file_exists($opt['rootpath'] . 'cache2/labels-' . $opt['template']['locale'] . '.inc.php')) {
9
+if (!file_exists($opt['rootpath'].'cache2/labels-'.$opt['template']['locale'].'.inc.php')) {
10 10
     labels::CreateCacheFile();
11 11
 }
12 12
 
13
-require $opt['rootpath'] . 'cache2/labels-' . $opt['template']['locale'] . '.inc.php';
13
+require $opt['rootpath'].'cache2/labels-'.$opt['template']['locale'].'.inc.php';
14 14
 
15 15
 class labels
16 16
 {
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     {
21 21
         global $opt;
22 22
 
23
-        $f = fopen($opt['rootpath'] . 'cache2/labels-' . $opt['template']['locale'] . '.inc.php', 'w');
23
+        $f = fopen($opt['rootpath'].'cache2/labels-'.$opt['template']['locale'].'.inc.php', 'w');
24 24
         fwrite($f, "<?php\n");
25 25
 
26 26
         $a = array();
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             $a[$r['id']] = $r['name'];
43 43
         }
44 44
         sql_free_result($rs);
45
-        fwrite($f, 'labels::addLabels("cache_attrib", "' . str_replace('"', '\\"', serialize($a)) . '");' . "\n");
45
+        fwrite($f, 'labels::addLabels("cache_attrib", "'.str_replace('"', '\\"', serialize($a)).'");'."\n");
46 46
 
47 47
         $a = [];
48 48
         $rs = sql(
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             $a[$r['id']] = $r['name'];
64 64
         }
65 65
         sql_free_result($rs);
66
-        fwrite($f, 'labels::addLabels("cache_size", "' . str_replace('"', '\\"', serialize($a)) . '");' . "\n");
66
+        fwrite($f, 'labels::addLabels("cache_size", "'.str_replace('"', '\\"', serialize($a)).'");'."\n");
67 67
 
68 68
         $a = [];
69 69
         $rs = sql(
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             $a[$r['id']] = $r['name'];
85 85
         }
86 86
         sql_free_result($rs);
87
-        fwrite($f, 'labels::addLabels("cache_status", "' . str_replace('"', '\\"', serialize($a)) . '");' . "\n");
87
+        fwrite($f, 'labels::addLabels("cache_status", "'.str_replace('"', '\\"', serialize($a)).'");'."\n");
88 88
 
89 89
         $a = [];
90 90
         $rs = sql(
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             $a[$r['id']] = $r['name'];
106 106
         }
107 107
         sql_free_result($rs);
108
-        fwrite($f, 'labels::addLabels("cache_type", "' . str_replace('"', '\\"', serialize($a)) . '");' . "\n");
108
+        fwrite($f, 'labels::addLabels("cache_type", "'.str_replace('"', '\\"', serialize($a)).'");'."\n");
109 109
 
110 110
         $a = [];
111 111
         $rs = sql(
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             $a[$r['id']] = $r['name'];
127 127
         }
128 128
         sql_free_result($rs);
129
-        fwrite($f, 'labels::addLabels("log_types", "' . str_replace('"', '\\"', serialize($a)) . '");' . "\n");
129
+        fwrite($f, 'labels::addLabels("log_types", "'.str_replace('"', '\\"', serialize($a)).'");'."\n");
130 130
 
131 131
         $nLastGroup = 1;
132 132
         $a = array();
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             $a[] = $r;
156 156
         }
157 157
         sql_free_result($rs);
158
-        fwrite($f, 'labels::addLabels("usercountrieslist", "' . str_replace('"', '\\"', serialize($a)) . '");' . "\n");
158
+        fwrite($f, 'labels::addLabels("usercountrieslist", "'.str_replace('"', '\\"', serialize($a)).'");'."\n");
159 159
 
160 160
         fwrite($f, "?>");
161 161
         fclose($f);
Please login to merge, or discard this patch.
htdocs/lib2/logic/statpic.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,8 +71,8 @@
 block discarded – undo
71 71
         global $opt;
72 72
 
73 73
         // if data changed - delete statpic of user, if exists - will be recreated on next request
74
-        if (file_exists($opt['rootpath'] . 'images/statpics/statpic' . $this->nUserId . '.jpg')) {
75
-            unlink($opt['rootpath'] . 'images/statpics/statpic' . $this->nUserId . '.jpg');
74
+        if (file_exists($opt['rootpath'].'images/statpics/statpic'.$this->nUserId.'.jpg')) {
75
+            unlink($opt['rootpath'].'images/statpics/statpic'.$this->nUserId.'.jpg');
76 76
         }
77 77
     }
78 78
 }
Please login to merge, or discard this patch.
htdocs/lib2/logic/geodb.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     private static function setCacheLocation($cache_id)
34 34
     {
35
-        echo $cache_id . "\n";
35
+        echo $cache_id."\n";
36 36
         $rs = sqll(
37 37
             "SELECT `latitude`, `longitude`, `last_modified`
38 38
              FROM `caches`
@@ -95,16 +95,16 @@  discard block
 block discarded – undo
95 95
         $rs = sqll(
96 96
             "SELECT
97 97
                 `geodb_coordinates`.`loc_id` `loc_id`,
98
-                (( " . $lon . " - `geodb_coordinates`.`lon` ) * ( " . $lon . " - `geodb_coordinates`.`lon` ) +
99
-                 ( " . $lat . " - `geodb_coordinates`.`lat` ) * ( " . $lat . " - `geodb_coordinates`.`lat` )) `dist`
98
+                (( " . $lon." - `geodb_coordinates`.`lon` ) * ( ".$lon." - `geodb_coordinates`.`lon` ) +
99
+                 ( " . $lat." - `geodb_coordinates`.`lat` ) * ( ".$lat." - `geodb_coordinates`.`lat` )) `dist`
100 100
              FROM `geodb_coordinates`
101 101
              INNER JOIN `geodb_locations` ON `geodb_coordinates`.`loc_id`=`geodb_locations`.`loc_id`
102 102
              WHERE
103 103
                 `geodb_locations`.`loc_type`=100700000
104
-                AND `geodb_coordinates`.`lon` > " . ($lon - 0.15) . "
105
-                AND `geodb_coordinates`.`lon` < " . ($lon + 0.15) . "
106
-                AND `geodb_coordinates`.`lat` > " . ($lat - 0.15) . "
107
-                AND `geodb_coordinates`.`lat` < " . ($lat + 0.15) . "
104
+                AND `geodb_coordinates`.`lon` > " . ($lon - 0.15)."
105
+                AND `geodb_coordinates`.`lon` < " . ($lon + 0.15)."
106
+                AND `geodb_coordinates`.`lat` > " . ($lat - 0.15)."
107
+                AND `geodb_coordinates`.`lat` < " . ($lat + 0.15)."
108 108
              ORDER BY `dist` ASC
109 109
              LIMIT 1"
110 110
         );
Please login to merge, or discard this patch.
htdocs/lib2/logic/npas.inc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@
 block discarded – undo
34 34
 
35 35
     $npas = get_npas($cache_id);
36 36
     if ($npas) {
37
-        $desc = "<p>" . str_replace('%1', helppagelink('npa'), _('This geocache is probably placed within the following protected areas (%1Info</a>):')) . "</p>\n" .
37
+        $desc = "<p>".str_replace('%1', helppagelink('npa'), _('This geocache is probably placed within the following protected areas (%1Info</a>):'))."</p>\n".
38 38
             "<ul>\n";
39 39
         foreach ($npas as $npa) {
40
-            $desc .= "<li>" . $npa['npaTypeName'] . ": <a href='http://www.google.de/search?q=" . urlencode($npa['npaTypeName'] . ' ' . $npa['npaName']) . "' target='_blank'>" . $npa['npaName'] . "</a></li>\n";
40
+            $desc .= "<li>".$npa['npaTypeName'].": <a href='http://www.google.de/search?q=".urlencode($npa['npaTypeName'].' '.$npa['npaName'])."' target='_blank'>".$npa['npaName']."</a></li>\n";
41 41
         }
42 42
         $desc .= "</ul>\n";
43 43
     } else {
Please login to merge, or discard this patch.
htdocs/lib2/logic/useroptions.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  *
9 9
  ***************************************************************************/
10 10
 
11
-require_once __DIR__ . '/const.inc.php';
11
+require_once __DIR__.'/const.inc.php';
12 12
 
13 13
 class useroptions
14 14
 {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             $this->nOptions[$pId]['option_value'] = $pValue;
151 151
 
152 152
             return true;
153
-        } elseif (preg_match("/" . $this->nOptions[$pId]['check_regex'] . "/", $pValue) || strlen($pValue) == 0) {
153
+        } elseif (preg_match("/".$this->nOptions[$pId]['check_regex']."/", $pValue) || strlen($pValue) == 0) {
154 154
             $this->nOptions[$pId]['option_value'] = $pValue;
155 155
 
156 156
             return true;
Please login to merge, or discard this patch.
htdocs/lib2/logic/logtypes.inc.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
          FROM `log_types`
29 29
          LEFT JOIN `sys_trans_text`
30 30
              ON `sys_trans_text`.`trans_id` = `log_types`.`trans_id`
31
-             AND `sys_trans_text`.`lang`='" . sql_escape($locale) . "'"
31
+             AND `sys_trans_text`.`lang`='" . sql_escape($locale)."'"
32 32
     );
33 33
     while ($r = sql_fetch_array($rs)) {
34 34
         $log_types[$r['id']] = $r['type_name'];
@@ -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.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,8 @@
 block discarded – undo
104 104
             $allowed_logtypes[] = 14;
105 105
         }  // locked, invisible
106 106
     }
107
-    if ($cache_type == 6) { // event
107
+    if ($cache_type == 6) {
108
+// event
108 109
         $allowed_logtypes[] = 8;   // will attend
109 110
         $allowed_logtypes[] = 7;   // attended
110 111
     } else {
Please login to merge, or discard this patch.
htdocs/lib2/cli.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@
 block discarded – undo
19 19
 }
20 20
 
21 21
 // chicken-egg problem ...
22
-require_once $opt['rootpath'] . 'lib2/const.inc.php';
22
+require_once $opt['rootpath'].'lib2/const.inc.php';
23 23
 
24 24
 // do all output in text format
25 25
 $opt['gui'] = GUI_TEXT;
26 26
 
27 27
 // include the main library
28
-require_once $opt['rootpath'] . 'lib2/common.inc.php';
29
-require_once $opt['rootpath'] . 'lib2/cli.class.php';
28
+require_once $opt['rootpath'].'lib2/common.inc.php';
29
+require_once $opt['rootpath'].'lib2/cli.class.php';
30 30
 
31 31
 if (($opt['debug'] & DEBUG_OUTOFSERVICE) == DEBUG_OUTOFSERVICE) {
32 32
     $cli->debug('exit because DEBUG_OUTOFSERVICE is set');
Please login to merge, or discard this patch.
htdocs/lib2/rss.class.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     public function getPubDate()
43 43
     {
44 44
         if (empty($this->pubDate)) {
45
-            return date("d.m.y H:i:s") . "GMT";
45
+            return date("d.m.y H:i:s")."GMT";
46 46
         } else {
47 47
             return $this->pubDate;
48 48
         }
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
     {
58 58
         $out = $this->header();
59 59
         $out .= "<channel>\n";
60
-        $out .= "<title>" . $this->title . "</title>\n";
61
-        $out .= "<link>" . $this->link . "</link>\n";
62
-        $out .= "<description>" . $this->description . "</description>\n";
63
-        $out .= "<language>" . $this->language . "</language>\n";
64
-        $out .= "<pubDate>" . $this->getPubDate() . "</pubDate>\n";
60
+        $out .= "<title>".$this->title."</title>\n";
61
+        $out .= "<link>".$this->link."</link>\n";
62
+        $out .= "<description>".$this->description."</description>\n";
63
+        $out .= "<language>".$this->language."</language>\n";
64
+        $out .= "<pubDate>".$this->getPubDate()."</pubDate>\n";
65 65
 
66 66
         foreach ($this->tags as $key => $val) {
67 67
             $out .= "<$key>$val</$key>\n";
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
 
89 89
     public function header()
90 90
     {
91
-        $out = '<?xml version="1.0" encoding="utf-8"?>' . "\n";
92
-        $out .= '<rss version="2.0">' . "\n";
91
+        $out = '<?xml version="1.0" encoding="utf-8"?>'."\n";
92
+        $out .= '<rss version="2.0">'."\n";
93 93
 
94 94
         return $out;
95 95
     }
@@ -141,10 +141,10 @@  discard block
 block discarded – undo
141 141
     public function out()
142 142
     {
143 143
         $out = "<item>\n";
144
-        $out .= "<title>" . $this->title . "</title>\n";
145
-        $out .= "<link>" . $this->link . "</link>\n";
146
-        $out .= "<description>" . $this->description . "</description>\n";
147
-        $out .= "<pubDate>" . $this->getPubDate() . "</pubDate>\n";
144
+        $out .= "<title>".$this->title."</title>\n";
145
+        $out .= "<link>".$this->link."</link>\n";
146
+        $out .= "<description>".$this->description."</description>\n";
147
+        $out .= "<pubDate>".$this->getPubDate()."</pubDate>\n";
148 148
 
149 149
         if ($this->attachment != "") {
150 150
             $out .= "<enclosure url='{$this->attachment}' length='{$this->length}' type='{$this->mimetype}' />";
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         if (empty($this->guid)) {
154 154
             $this->guid = $this->link;
155 155
         }
156
-        $out .= "<guid>" . $this->guid . "</guid>\n";
156
+        $out .= "<guid>".$this->guid."</guid>\n";
157 157
 
158 158
         foreach ($this->tags as $key => $val) {
159 159
             $out .= "<$key>$val</$key\n>";
Please login to merge, or discard this patch.