@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $year = substr($cache['date_created'], 0, 4); |
25 | 25 | if ($year >= 2005 && $year <= date('Y') && ($lat != 0 || $long != 0)) { |
26 | 26 | $years[$year] = true; |
27 | - $liste[$lat][$long]['caches'][$year] ++; |
|
27 | + $liste[$lat][$long]['caches'][$year]++; |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 | mysqli_free_result($rs); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $year = substr($cache['date'], 0, 4); |
49 | 49 | if ($year >= 2005 && $year <= date('Y') && ($lat != 0 || $long != 0)) { |
50 | 50 | $years[$year] = true; |
51 | - $liste[$lat][$long]['logs'][$year] ++; |
|
51 | + $liste[$lat][$long]['logs'][$year]++; |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | mysqli_free_result($rs); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | while ($cache = sql_fetch_assoc($rs)) { |
66 | 66 | $lat = floor($cache['latitude'] / $grid); |
67 | 67 | $long = floor($cache['longitude'] / $grid); |
68 | - $liste[$lat][$long]['caches']['all'] ++; |
|
68 | + $liste[$lat][$long]['caches']['all']++; |
|
69 | 69 | $liste[$lat][$long]['logs']['all'] += $cache['logs']; |
70 | 70 | } |
71 | 71 | mysqli_free_result($rs); |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | isset($_REQUEST['desclang']) && |
23 | 23 | !isset($_REQUEST['descid'])) { // Ocprop |
24 | 24 | |
25 | - $cache_id = $_REQUEST['cacheid']; // Ocprop |
|
26 | - $desc_lang = $_REQUEST['desclang']; // Ocprop |
|
25 | + $cache_id = $_REQUEST['cacheid']; // Ocprop |
|
26 | + $desc_lang = $_REQUEST['desclang']; // Ocprop |
|
27 | 27 | |
28 | 28 | $rs = sql("SELECT `id` FROM `cache_desc` WHERE `cache_id`='&1' AND `language`='&2'", $cache_id, $desc_lang); |
29 | 29 | if (mysqli_num_rows($rs) == 1) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | //save to DB? |
91 | 91 | if (isset($_POST['post'])) { // Ocprop |
92 | 92 | //here we read all used information from the form if submitted |
93 | - $descMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 1; // Ocprop |
|
93 | + $descMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 1; // Ocprop |
|
94 | 94 | |
95 | 95 | // fuer alte Versionen von OCProp |
96 | 96 | if (isset($_POST['submit']) && !isset($_POST['version2'])) { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $oldDescMode = $descMode; |
124 | 124 | } |
125 | 125 | |
126 | - $short_desc = trim($_POST['short_desc']); // Ocprop |
|
126 | + $short_desc = trim($_POST['short_desc']); // Ocprop |
|
127 | 127 | $hint = htmlspecialchars(trim($_POST['hints']), ENT_COMPAT, 'UTF-8'); |
128 | 128 | $desclang = $_POST['desclang']; |
129 | 129 | $show_all_langs = isset($_POST['show_all_langs_value']) ? $_POST['show_all_langs_value'] : 0; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | // Text from textarea |
141 | - $desc = trim($_POST['desc']); // Ocprop |
|
141 | + $desc = trim($_POST['desc']); // Ocprop |
|
142 | 142 | |
143 | 143 | // fuer alte Versionen von OCProp |
144 | 144 | if (isset($_POST['submit']) && !isset($_POST['version2'])) { |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | tpl_set_var('desclang', htmlspecialchars($desc_lang, ENT_COMPAT, 'UTF-8')); |
296 | 296 | tpl_set_var('desclang_name', htmlspecialchars(db_LanguageFromShort($desc_lang), ENT_COMPAT, 'UTF-8')); |
297 | 297 | tpl_set_var('cachename', htmlspecialchars($desc_record['name'], ENT_COMPAT, 'UTF-8')); |
298 | - tpl_set_var('reset', $reset); // obsolete |
|
298 | + tpl_set_var('reset', $reset); // obsolete |
|
299 | 299 | tpl_set_var('submit', $submit); |
300 | 300 | |
301 | 301 | // Text / normal HTML / HTML editor |
@@ -47,7 +47,7 @@ |
||
47 | 47 | // REQUEST-Variablen durchlaufen und an target anhaengen |
48 | 48 | $allowed = ['cacheid', 'userid', 'logid', 'desclang', 'descid']; |
49 | 49 | |
50 | -foreach($_REQUEST as $varname => $varvalue) { |
|
50 | +foreach ($_REQUEST as $varname => $varvalue) { |
|
51 | 51 | if (in_array($varname, $allowed)) { |
52 | 52 | $target .= $varname . '=' . $varvalue . '&'; |
53 | 53 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | <?php |
156 | 156 | foreach ($opt['template']['locales'] as $k => $lang) { |
157 | 157 | if ($lang['status'] == OC_LOCALE_ACTIVE) { |
158 | - echo '<a style="text-decoration: none;" href="'.$langUrl . $k . '"><img src="' . $lang['flag'] . |
|
158 | + echo '<a style="text-decoration: none;" href="' . $langUrl . $k . '"><img src="' . $lang['flag'] . |
|
159 | 159 | '" alt="' . $lang['name'] . '" title="' . $lang['name'] . '" width="24px" height="18px" /></a> '; |
160 | 160 | } |
161 | 161 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | $nLastGroup = $tpl_usercountries[$i]['group']; |
187 | 187 | |
188 | - echo '<option value="' . htmlspecialchars($tpl_usercountries[$i]['country'], ENT_COMPAT, 'UTF-8') . '"' . (($sUserCountry==$tpl_usercountries[$i]['country']) ? ' selected="selected"' : '') . '>' . htmlspecialchars($tpl_usercountries[$i]['name'], ENT_COMPAT, 'UTF-8') . '</option>'; |
|
188 | + echo '<option value="' . htmlspecialchars($tpl_usercountries[$i]['country'], ENT_COMPAT, 'UTF-8') . '"' . (($sUserCountry == $tpl_usercountries[$i]['country']) ? ' selected="selected"' : '') . '>' . htmlspecialchars($tpl_usercountries[$i]['name'], ENT_COMPAT, 'UTF-8') . '</option>'; |
|
189 | 189 | } |
190 | 190 | ?> |
191 | 191 | </select> |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | </div> <!-- page-container-1 --> |
391 | 391 | |
392 | 392 | </div> <!-- overall --> |
393 | - <?php if($opt['tracking']['googleAnalytics']) { ?> |
|
393 | + <?php if ($opt['tracking']['googleAnalytics']) { ?> |
|
394 | 394 | <script type="text/javascript"> |
395 | 395 | // Set to the same value as the web property used on the site |
396 | 396 | var gaProperty = '<?= $opt['tracking']['googleAnalytics']; ?>'; |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | // return array(); |
358 | 358 | // Logic Error - log types are still valid when no NEW logs are allowed for the cache. |
359 | 359 | // (Would e.g. block admin logs and log-type restoring for locked caches.) |
360 | - return get_cache_log_types($this->getCacheId(), $this->getType()); // depends on userid |
|
360 | + return get_cache_log_types($this->getCacheId(), $this->getType()); // depends on userid |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | public static function isDuplicate($cacheId, $userId, $logType, $logDate, $logText) |
@@ -443,8 +443,8 @@ discard block |
||
443 | 443 | if ($dateOk && $submit) { |
444 | 444 | $dateOk = ( |
445 | 445 | mktime( |
446 | - (int) $hour, |
|
447 | - (int) $minute, |
|
446 | + (int)$hour, |
|
447 | + (int)$minute, |
|
448 | 448 | 0, |
449 | 449 | $month, |
450 | 450 | $day, |
@@ -1,4 +1,4 @@ |
||
1 | 1 | <?php return array ( |
2 | - 'version_number' => 1908, |
|
3 | - 'git_revision' => '6be38dcd869651db7dd2fddf94a09e3f64519320', |
|
2 | + 'version_number' => 1908, |
|
3 | + 'git_revision' => '6be38dcd869651db7dd2fddf94a09e3f64519320', |
|
4 | 4 | ); |
5 | 5 | \ No newline at end of file |
@@ -1,4 +1,4 @@ |
||
1 | -<?php return array ( |
|
1 | +<?php return array( |
|
2 | 2 | 'version_number' => 1908, |
3 | 3 | 'git_revision' => '6be38dcd869651db7dd2fddf94a09e3f64519320', |
4 | 4 | ); |
5 | 5 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
20 | - * @param $userCountry |
|
20 | + * @param string $userCountry |
|
21 | 21 | */ |
22 | 22 | public function set_userCountry($userCountry): void |
23 | 23 | { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * |
42 | 42 | * @param string $type type of the "new"-information, i.e. cache, event, rating, etc |
43 | 43 | * @param array $args numeric array containing the parameter for "sql_slave" |
44 | - * @return object mysql result used by smarty assign_rs |
|
44 | + * @return mysqli_result|null mysql result used by smarty assign_rs |
|
45 | 45 | */ |
46 | 46 | public function rsForSmarty($type, $args = null) |
47 | 47 | { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * cacheRs executes the database statements for type "cache" |
90 | 90 | * |
91 | 91 | * @param array $args numeric array containing the parameter for "sql_slave" |
92 | - * @return object mysql result used by smarty assign_rs |
|
92 | + * @return mysqli_result mysql result used by smarty assign_rs |
|
93 | 93 | */ |
94 | 94 | private function cacheRs($args = null) |
95 | 95 | { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * eventRs executes the database statements for type "event" |
144 | 144 | * |
145 | 145 | * @param array $args numeric array containing the parameter for "sql_slave" |
146 | - * @return object mysql result used by smarty assign_rs |
|
146 | + * @return mysqli_result mysql result used by smarty assign_rs |
|
147 | 147 | */ |
148 | 148 | private function eventRs($args = null) |
149 | 149 | { |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * ratingRs executes the database statements for type "rating" |
216 | 216 | * |
217 | 217 | * @param array $args numeric array containing the parameter for "sql_slave" |
218 | - * @return object mysql result used by smarty assign_rs |
|
218 | + * @return mysqli_result mysql result used by smarty assign_rs |
|
219 | 219 | */ |
220 | 220 | private function ratingRs($args = null) |
221 | 221 | { |
@@ -147,11 +147,17 @@ discard block |
||
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
150 | + /** |
|
151 | + * @param integer $zoom |
|
152 | + */ |
|
150 | 153 | private function lonToTile($long, $zoom) |
151 | 154 | { |
152 | 155 | return (($long + 180) / 360) * (2 ** $zoom); |
153 | 156 | } |
154 | 157 | |
158 | + /** |
|
159 | + * @param integer $zoom |
|
160 | + */ |
|
155 | 161 | private function latToTile($lat, $zoom) |
156 | 162 | { |
157 | 163 | return (1 - log(tan($lat * M_PI / 180) + 1 / cos($lat * M_PI / 180)) / M_PI) / 2 * (2 ** $zoom); |
@@ -247,6 +253,10 @@ discard block |
||
247 | 253 | } |
248 | 254 | } |
249 | 255 | |
256 | + /** |
|
257 | + * @param string $pathname |
|
258 | + * @param integer $mode |
|
259 | + */ |
|
250 | 260 | private function mkdirRecursive($pathname, $mode): bool |
251 | 261 | { |
252 | 262 | is_dir(dirname($pathname)) || $this->mkdirRecursive(dirname($pathname), $mode); |
@@ -254,6 +264,9 @@ discard block |
||
254 | 264 | return is_dir($pathname) || mkdir($pathname, $mode) || is_dir($pathname); |
255 | 265 | } |
256 | 266 | |
267 | + /** |
|
268 | + * @param string $data |
|
269 | + */ |
|
257 | 270 | private function writeTileToCache($url, $data): void |
258 | 271 | { |
259 | 272 | $filename = $this->tileUrlToFilename($url); |
@@ -261,6 +274,9 @@ discard block |
||
261 | 274 | file_put_contents($filename, $data); |
262 | 275 | } |
263 | 276 | |
277 | + /** |
|
278 | + * @param string $url |
|
279 | + */ |
|
264 | 280 | private function fetchTile($url) |
265 | 281 | { |
266 | 282 | if ($this->useTileCache && $cached = $this->checkTileCache($url)) { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * @var string |
59 | 59 | */ |
60 | - private $tileCacheBaseDir = __DIR__ . '/../../../var/cache2/staticmap'; |
|
60 | + private $tileCacheBaseDir = __DIR__ . '/../../../var/cache2/staticmap'; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * @var int |
@@ -127,11 +127,11 @@ discard block |
||
127 | 127 | |
128 | 128 | if (isset($_GET['size']) && !empty($_GET['size'])) { |
129 | 129 | list($this->width, $this->height) = explode('x', $_GET['size']); |
130 | - $this->width = (int) $this->width; |
|
130 | + $this->width = (int)$this->width; |
|
131 | 131 | if ($this->width > $this->maxWidth) { |
132 | 132 | $this->width = $this->maxWidth; |
133 | 133 | } |
134 | - $this->height = (int) $this->height; |
|
134 | + $this->height = (int)$this->height; |
|
135 | 135 | if ($this->height > $this->maxHeight) { |
136 | 136 | $this->height = $this->maxHeight; |
137 | 137 | } |
@@ -133,6 +133,9 @@ |
||
133 | 133 | sql_free_result($rs); |
134 | 134 | } |
135 | 135 | |
136 | + /** |
|
137 | + * @param string $comment |
|
138 | + */ |
|
136 | 139 | public function archiveCache($cache_id, $comment, $months = 0): void |
137 | 140 | { |
138 | 141 | global $login, $translate; |