@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | protected function execute(InputInterface $input, OutputInterface $output) |
35 | 35 | { |
36 | 36 | $command = $input->getOption(self::OPTION_FIX) ? 'phpcbf' : 'phpcs'; |
37 | - $cmd = 'vendor/bin/'.($command).' --standard=PSR2 -p -n --colors src/'; |
|
37 | + $cmd = 'vendor/bin/' . ($command) . ' --standard=PSR2 -p -n --colors src/'; |
|
38 | 38 | |
39 | 39 | if ($input->getOption(self::OPTION_DRY_RUN)) { |
40 | 40 | $output->writeln($cmd); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | $process = new Process($cmd, $this->rootPath, null, null, 9600); |
46 | - $process->run(function ($type, $buffer) { |
|
46 | + $process->run(function($type, $buffer) { |
|
47 | 47 | echo $buffer; |
48 | 48 | }); |
49 | 49 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | $tr = []; |
25 | 25 | $p = 0; |
26 | 26 | |
27 | - for ($i = 1; $i < func_num_args(); $i ++) { |
|
27 | + for ($i = 1; $i < func_num_args(); $i++) { |
|
28 | 28 | $arg = func_get_arg($i); |
29 | 29 | |
30 | 30 | if (is_array($arg)) { |
@@ -32,7 +32,7 @@ |
||
32 | 32 | if (!isset($counter[$name])) { |
33 | 33 | $counter[$name] = 0; |
34 | 34 | } |
35 | - $counter[$name] ++; |
|
35 | + $counter[$name]++; |
|
36 | 36 | |
37 | 37 | if ($smarty->_cache_including) { |
38 | 38 | $param = isset($smarty->_cache_info['cached_vars'][$name][$counter[$name]]) ? $smarty->_cache_info['cached_vars'][$name][$counter[$name]] : []; |
@@ -80,7 +80,7 @@ |
||
80 | 80 | ]; |
81 | 81 | |
82 | 82 | $nTimestamp = time(); |
83 | - for ($nIndex = 0; $nIndex < count($seasons); $nIndex ++) { |
|
83 | + for ($nIndex = 0; $nIndex < count($seasons); $nIndex++) { |
|
84 | 84 | if (strtotime($seasons[$nIndex][0]) > $nTimestamp) { |
85 | 85 | return $params['winter']; |
86 | 86 | } //''; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | require_once $stylepath . '/' . $tplname . '.inc.php'; |
37 | 37 | |
38 | 38 | //set template replacements |
39 | - tpl_set_var('reset', $reset); // obsolete |
|
39 | + tpl_set_var('reset', $reset); // obsolete |
|
40 | 40 | tpl_set_var('submit', $submit); |
41 | 41 | tpl_set_var('general_message', ''); |
42 | 42 | tpl_set_var('hidden_since_message', ''); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | tpl_set_var('diff_message', ''); |
54 | 54 | tpl_set_var('safari_message', ''); |
55 | 55 | |
56 | - $sel_type = isset($_POST['type']) ? $_POST['type'] : 0; // Ocprop |
|
56 | + $sel_type = isset($_POST['type']) ? $_POST['type'] : 0; // Ocprop |
|
57 | 57 | if (!isset($_POST['size'])) { |
58 | 58 | if ($sel_type == 4 || $sel_type == 5) { |
59 | 59 | $sel_size = 7; |
@@ -61,15 +61,15 @@ discard block |
||
61 | 61 | $sel_size = - 1; |
62 | 62 | } |
63 | 63 | } else { |
64 | - $sel_size = isset($_POST['size']) ? $_POST['size'] : - 1; // Ocprop |
|
64 | + $sel_size = isset($_POST['size']) ? $_POST['size'] : - 1; // Ocprop |
|
65 | 65 | } |
66 | 66 | $sel_lang = isset($_POST['desc_lang']) ? $_POST['desc_lang'] : $default_lang; |
67 | - $sel_country = isset($_POST['country']) ? $_POST['country'] : getUserCountry(); // Ocprop |
|
67 | + $sel_country = isset($_POST['country']) ? $_POST['country'] : getUserCountry(); // Ocprop |
|
68 | 68 | $show_all_countries = isset($_POST['show_all_countries']) ? $_POST['show_all_countries'] : 0; |
69 | 69 | $show_all_langs = isset($_POST['show_all_langs']) ? $_POST['show_all_langs'] : 0; |
70 | 70 | |
71 | 71 | //coords |
72 | - $lonEW = isset($_POST['lonEW']) ? $_POST['lonEW'] : $default_EW; // Ocprop |
|
72 | + $lonEW = isset($_POST['lonEW']) ? $_POST['lonEW'] : $default_EW; // Ocprop |
|
73 | 73 | if ($lonEW == 'E') { |
74 | 74 | tpl_set_var('lonEsel', ' selected="selected"'); |
75 | 75 | tpl_set_var('lonWsel', ''); |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | tpl_set_var('lonEsel', ''); |
78 | 78 | tpl_set_var('lonWsel', ' selected="selected"'); |
79 | 79 | } |
80 | - $lon_h = isset($_POST['lon_h']) ? $_POST['lon_h'] : '0'; // Ocprop |
|
80 | + $lon_h = isset($_POST['lon_h']) ? $_POST['lon_h'] : '0'; // Ocprop |
|
81 | 81 | tpl_set_var('lon_h', htmlspecialchars($lon_h, ENT_COMPAT, 'UTF-8')); |
82 | 82 | |
83 | - $lon_min = isset($_POST['lon_min']) ? $_POST['lon_min'] : '00.000'; // Ocprop |
|
83 | + $lon_min = isset($_POST['lon_min']) ? $_POST['lon_min'] : '00.000'; // Ocprop |
|
84 | 84 | tpl_set_var('lon_min', htmlspecialchars($lon_min, ENT_COMPAT, 'UTF-8')); |
85 | 85 | |
86 | - $latNS = isset($_POST['latNS']) ? $_POST['latNS'] : $default_NS; // Ocprop |
|
86 | + $latNS = isset($_POST['latNS']) ? $_POST['latNS'] : $default_NS; // Ocprop |
|
87 | 87 | if ($latNS == 'N') { |
88 | 88 | tpl_set_var('latNsel', ' selected="selected"'); |
89 | 89 | tpl_set_var('latSsel', ''); |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | tpl_set_var('latNsel', ''); |
92 | 92 | tpl_set_var('latSsel', ' selected="selected"'); |
93 | 93 | } |
94 | - $lat_h = isset($_POST['lat_h']) ? $_POST['lat_h'] : '0'; // Ocprop |
|
94 | + $lat_h = isset($_POST['lat_h']) ? $_POST['lat_h'] : '0'; // Ocprop |
|
95 | 95 | tpl_set_var('lat_h', htmlspecialchars($lat_h, ENT_COMPAT, 'UTF-8')); |
96 | 96 | |
97 | - $lat_min = isset($_POST['lat_min']) ? $_POST['lat_min'] : '00.000'; // Ocprop |
|
97 | + $lat_min = isset($_POST['lat_min']) ? $_POST['lat_min'] : '00.000'; // Ocprop |
|
98 | 98 | tpl_set_var('lat_min', htmlspecialchars($lat_min, ENT_COMPAT, 'UTF-8')); |
99 | 99 | |
100 | 100 | //name |
101 | - $name = isset($_POST['name']) ? trim($_POST['name']) : ''; // Ocprop |
|
101 | + $name = isset($_POST['name']) ? trim($_POST['name']) : ''; // Ocprop |
|
102 | 102 | tpl_set_var('name', htmlspecialchars($name, ENT_COMPAT, 'UTF-8')); |
103 | 103 | |
104 | 104 | //shortdesc |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | // fuer alte Versionen von OCProp |
132 | 132 | if (isset($_POST['submit']) && !isset($_POST['version2'])) { |
133 | - $descMode = (isset($_POST['desc_html']) && ($_POST['desc_html'] == 1)) ? 2 : 1; // Ocprop |
|
133 | + $descMode = (isset($_POST['desc_html']) && ($_POST['desc_html'] == 1)) ? 2 : 1; // Ocprop |
|
134 | 134 | $_POST['submitform'] = $_POST['submit']; |
135 | 135 | |
136 | 136 | $short_desc = iconv("ISO-8859-1", "UTF-8", $short_desc); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | //tos |
199 | - $tos = isset($_POST['TOS']) ? 1 : 0; // Ocprop |
|
199 | + $tos = isset($_POST['TOS']) ? 1 : 0; // Ocprop |
|
200 | 200 | if ($tos == 1) { |
201 | 201 | tpl_set_var('toschecked', ' checked="checked"'); |
202 | 202 | } else { |
@@ -204,9 +204,9 @@ discard block |
||
204 | 204 | } |
205 | 205 | |
206 | 206 | //hidden_since |
207 | - $hidden_day = isset($_POST['hidden_day']) ? $_POST['hidden_day'] : date('d'); // Ocprop |
|
208 | - $hidden_month = isset($_POST['hidden_month']) ? $_POST['hidden_month'] : date('m'); // Ocprop |
|
209 | - $hidden_year = isset($_POST['hidden_year']) ? $_POST['hidden_year'] : date('Y'); // Ocprop |
|
207 | + $hidden_day = isset($_POST['hidden_day']) ? $_POST['hidden_day'] : date('d'); // Ocprop |
|
208 | + $hidden_month = isset($_POST['hidden_month']) ? $_POST['hidden_month'] : date('m'); // Ocprop |
|
209 | + $hidden_year = isset($_POST['hidden_year']) ? $_POST['hidden_year'] : date('Y'); // Ocprop |
|
210 | 210 | tpl_set_var('hidden_day', htmlspecialchars($hidden_day, ENT_COMPAT, 'UTF-8')); |
211 | 211 | tpl_set_var('hidden_month', htmlspecialchars($hidden_month, ENT_COMPAT, 'UTF-8')); |
212 | 212 | tpl_set_var('hidden_year', htmlspecialchars($hidden_year, ENT_COMPAT, 'UTF-8')); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | tpl_set_var('publish_later_checked', ''); |
224 | 224 | tpl_set_var('publish_notnow_checked', ''); |
225 | 225 | |
226 | - $publish = isset($_POST['publish']) ? $_POST['publish'] : 'now2'; // Ocprop |
|
226 | + $publish = isset($_POST['publish']) ? $_POST['publish'] : 'now2'; // Ocprop |
|
227 | 227 | if ($publish == 'now2') { |
228 | 228 | tpl_set_var('publish_now_checked', 'checked'); |
229 | 229 | } elseif ($publish == 'later') { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | // fill activate hours |
238 | 238 | $activate_hour = isset($_POST['activate_hour']) ? $_POST['activate_hour'] + 0 : date('H') + 0; |
239 | 239 | $activation_hours = ''; |
240 | - for ($i = 0; $i <= 23; $i ++) { |
|
240 | + for ($i = 0; $i <= 23; $i++) { |
|
241 | 241 | if ($activate_hour == $i) { |
242 | 242 | $activation_hours .= '<option value="' . $i . '" selected="selected">' . $i . '</option>'; |
243 | 243 | } else { |
@@ -253,13 +253,13 @@ discard block |
||
253 | 253 | |
254 | 254 | // gc- and nc-waypoints |
255 | 255 | // fix #4356: gc waypoints are frequently copy&pasted with leading spaces |
256 | - $wp_gc = isset($_POST['wp_gc']) ? strtoupper(trim($_POST['wp_gc'])) : ''; // Ocprop |
|
256 | + $wp_gc = isset($_POST['wp_gc']) ? strtoupper(trim($_POST['wp_gc'])) : ''; // Ocprop |
|
257 | 257 | tpl_set_var('wp_gc', htmlspecialchars($wp_gc, ENT_COMPAT, 'UTF-8')); |
258 | 258 | |
259 | 259 | //difficulty |
260 | - $difficulty = isset($_POST['difficulty']) ? $_POST['difficulty'] : 1; // Ocprop |
|
260 | + $difficulty = isset($_POST['difficulty']) ? $_POST['difficulty'] : 1; // Ocprop |
|
261 | 261 | $difficulty_options = '<option value="1">' . $sel_message . '</option>'; |
262 | - for ($i = 2; $i <= 10; $i ++) { |
|
262 | + for ($i = 2; $i <= 10; $i++) { |
|
263 | 263 | if ($difficulty == $i) { |
264 | 264 | $difficulty_options .= '<option value="' . $i . '" selected="selected">' . $i / 2 . '</option>'; |
265 | 265 | } else { |
@@ -270,9 +270,9 @@ discard block |
||
270 | 270 | tpl_set_var('difficulty_options', $difficulty_options); |
271 | 271 | |
272 | 272 | //terrain |
273 | - $terrain = isset($_POST['terrain']) ? $_POST['terrain'] : 1; // Ocprop |
|
273 | + $terrain = isset($_POST['terrain']) ? $_POST['terrain'] : 1; // Ocprop |
|
274 | 274 | $terrain_options = '<option value="1">' . $sel_message . '</option>'; |
275 | - for ($i = 2; $i <= 10; $i ++) { |
|
275 | + for ($i = 2; $i <= 10; $i++) { |
|
276 | 276 | if ($terrain == $i) { |
277 | 277 | $terrain_options .= '<option value="' . $i . '" selected="selected">' . $i / 2 . '</option>'; |
278 | 278 | } else { |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | $line = mb_ereg_replace('{name}', escape_javascript($record['name']), $line); |
509 | 509 | $line = mb_ereg_replace('{color}', $rAttrGroup['color'], $line); |
510 | 510 | $group_line .= $line; |
511 | - $nLineAttrCount ++; |
|
511 | + $nLineAttrCount++; |
|
512 | 512 | |
513 | 513 | $line = $cache_attrib_js; |
514 | 514 | $line = mb_ereg_replace('{id}', $record['id'], $line); |
@@ -822,7 +822,7 @@ discard block |
||
822 | 822 | $activate_month, |
823 | 823 | $activate_day, |
824 | 824 | $activate_year |
825 | - )). "'"; |
|
825 | + )) . "'"; |
|
826 | 826 | } elseif ($publish == 'notnow') { |
827 | 827 | $sel_status = 5; |
828 | 828 | $activation_date = 'NULL'; |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | ); |
903 | 903 | |
904 | 904 | // insert cache-attributes |
905 | - for ($i = 0; $i < count($cache_attribs); $i ++) { |
|
905 | + for ($i = 0; $i < count($cache_attribs); $i++) { |
|
906 | 906 | if (($cache_attribs[$i] + 0) > 0) { |
907 | 907 | sql( |
908 | 908 | "INSERT INTO `caches_attributes` (`cache_id`, `attrib_id`) VALUES ('&1', '&2')", |
@@ -569,7 +569,8 @@ discard block |
||
569 | 569 | |
570 | 570 | tpl_set_var('firstcache_note', mb_ereg_replace('%1', $opt['page']['sitename'], $firstcache_note)); |
571 | 571 | |
572 | - if (isset($_POST['submitform'])) // Ocprop |
|
572 | + if (isset($_POST['submitform'])) { |
|
573 | + // Ocprop |
|
573 | 574 | { |
574 | 575 | //check the entered data |
575 | 576 | |
@@ -577,6 +578,7 @@ discard block |
||
577 | 578 | if ($lat_h != '' || $lat_min != '') { |
578 | 579 | if (!mb_ereg_match('^[0-9]{1,2}$', $lat_h)) { |
579 | 580 | tpl_set_var('lat_message', $error_lat_not_ok); |
581 | + } |
|
580 | 582 | $error = true; |
581 | 583 | $lat_h_not_ok = true; |
582 | 584 | } else { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | 'DATA_LICENSE_URL' => $opt['page']['absolute_url'] . $opt['logic']['license']['terms'], |
34 | 34 | 'DEBUG' => ($opt['debug'] & DEBUG_DEVELOPER != 0), |
35 | 35 | 'DEBUG_PREVENT_SEMAPHORES' |
36 | - => !$opt['php']['semaphores'], # not available on old developer system |
|
36 | + => !$opt['php']['semaphores'], # not available on old developer system |
|
37 | 37 | 'DB_SERVER' => $opt['db']['servername'], |
38 | 38 | 'DB_NAME' => $opt['db']['placeholder']['db'], |
39 | 39 | 'DB_USERNAME' => $opt['db']['username'], |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'OC_NODE_ID' => $opt['logic']['node']['id'], |
55 | 55 | 'OC_COOKIE_NAME' => $opt['session']['cookiename'] . 'data', |
56 | 56 | 'OCDE_HTML_PURIFIER_SETTINGS' |
57 | - => $opt['html_purifier'], |
|
57 | + => $opt['html_purifier'], |
|
58 | 58 | 'GITHUB_ACCESS_TOKEN' => $opt['okapi']['github_access_token'], |
59 | 59 | ); |
60 | 60 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | # [3] http://code.google.com/p/opencaching-api/issues/detail?id=132 |
17 | 17 | |
18 | 18 | $opt['rootpath'] = $GLOBALS['rootpath']; |
19 | - require $opt['rootpath'] . 'lib2/const.inc.php'; # (into the *local* scope!) |
|
19 | + require $opt['rootpath'] . 'lib2/const.inc.php'; # (into the *local* scope!) |
|
20 | 20 | require $opt['rootpath'] . 'config2/settings-dist.inc.php'; |
21 | 21 | require $opt['rootpath'] . 'config2/settings.inc.php'; |
22 | 22 | |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | # Settings which ARE NOT present in settings.inc.php: |
26 | 26 | |
27 | - 'OC_BRANCH' => 'oc.de', # Tell OKAPI to work in "OCDE mode". |
|
27 | + 'OC_BRANCH' => 'oc.de', # Tell OKAPI to work in "OCDE mode". |
|
28 | 28 | |
29 | 29 | # Settings which ARE present in settings.inc.php: |
30 | 30 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | 'DATA_LICENSE_URL' => $opt['page']['absolute_url'] . $opt['logic']['license']['terms'], |
34 | 34 | 'DEBUG' => ($opt['debug'] & DEBUG_DEVELOPER != 0), |
35 | 35 | 'DEBUG_PREVENT_SEMAPHORES' |
36 | - => !$opt['php']['semaphores'], # not available on old developer system |
|
36 | + => !$opt['php']['semaphores'], # not available on old developer system |
|
37 | 37 | 'DB_SERVER' => $opt['db']['servername'], |
38 | 38 | 'DB_NAME' => $opt['db']['placeholder']['db'], |
39 | 39 | 'DB_USERNAME' => $opt['db']['username'], |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | : $opt['page']['absolute_url'] . 'register.php', |
48 | 48 | 'VAR_DIR' => $opt['okapi']['var_dir'], |
49 | 49 | 'IMAGES_DIR' => rtrim($opt['logic']['pictures']['dir'], '/'), |
50 | - 'IMAGES_URL' => rtrim($opt['logic']['pictures']['url'], '/').'/', |
|
50 | + 'IMAGES_URL' => rtrim($opt['logic']['pictures']['url'], '/') . '/', |
|
51 | 51 | 'IMAGE_MAX_UPLOAD_SIZE' => 2 * $opt['logic']['pictures']['maxsize'], |
52 | - 'IMAGE_MAX_PIXEL_COUNT' => 786432, # 1024 x 768; TODO: move PICTURE_MAX_LONG_SIDE to settings |
|
52 | + 'IMAGE_MAX_PIXEL_COUNT' => 786432, # 1024 x 768; TODO: move PICTURE_MAX_LONG_SIDE to settings |
|
53 | 53 | 'SITE_LOGO' => $opt['page']['absolute_url'] . 'resource2/' . $opt['template']['default']['style'] . '/images/oclogo/oc_logo_alpha3.png', |
54 | 54 | 'OC_NODE_ID' => $opt['logic']['node']['id'], |
55 | 55 | 'OC_COOKIE_NAME' => $opt['session']['cookiename'] . 'data', |
@@ -48,14 +48,14 @@ |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | $hours = array(); |
51 | - for ($i = 0; $i < 24; $i ++) { |
|
51 | + for ($i = 0; $i < 24; $i++) { |
|
52 | 52 | $hours[] = [ |
53 | 53 | 'value' => $i, |
54 | 54 | 'time' => mktime($i, 0, 0) |
55 | 55 | ]; |
56 | 56 | } |
57 | 57 | $weekdays = array(); |
58 | - for ($i = 1; $i <= 7; $i ++) { |
|
58 | + for ($i = 1; $i <= 7; $i++) { |
|
59 | 59 | $weekdays[] = array( |
60 | 60 | 'value' => $i, |
61 | 61 | 'time' => mktime(0, 0, 0, 0, $i + 5, 2000) |
@@ -186,7 +186,7 @@ |
||
186 | 186 | } |
187 | 187 | $path .= mb_strtoupper(mb_substr($filename, 0, 1)) . '/' . |
188 | 188 | mb_strtoupper(mb_substr($filename, 1, 1)) . '/'; |
189 | - @unlink($path . $filename); // Thumb |
|
189 | + @unlink($path . $filename); // Thumb |
|
190 | 190 | |
191 | 191 | /* lib2 code would be ... |
192 | 192 | $rs = sql("SELECT `id` FROM `pictures` WHERE `object_type`=1 AND `object_id`='&1'", $log_id); |
@@ -12,8 +12,7 @@ |
||
12 | 12 | $tpl->change_country_inpage = true; |
13 | 13 | |
14 | 14 | $startat = isset($_REQUEST['startat']) ? floor($_REQUEST['startat'] + 0) : 0; |
15 | -$country = isset($_REQUEST['usercountry']) ? $_REQUEST['usercountry'] : |
|
16 | - (isset($_REQUEST['country']) ? $_REQUEST['country'] : ''); |
|
15 | +$country = isset($_REQUEST['usercountry']) ? $_REQUEST['usercountry'] : (isset($_REQUEST['country']) ? $_REQUEST['country'] : ''); |
|
17 | 16 | $cachetype = isset($_REQUEST['cachetype']) ? $_REQUEST['cachetype'] + 0 : 0; |
18 | 17 | $bEvents = ($cachetype == 6); |
19 | 18 |