@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $filesJson = json_decode(file_get_contents($projectDir . '/theme/frontend/js/files.json'), true); |
| 104 | 104 | $ownFiles = $filesJson['files']; |
| 105 | 105 | |
| 106 | - $ownFiles = array_map(function ($file) use ($applicationJsPath) { |
|
| 106 | + $ownFiles = array_map(function($file) use ($applicationJsPath) { |
|
| 107 | 107 | if (strpos($file, '**') !== false) { |
| 108 | 108 | return null; |
| 109 | 109 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $finder = new Finder(); |
| 117 | 117 | $finder->in($applicationJsPath . '/plugins/')->name('*.js'); |
| 118 | 118 | |
| 119 | - $jsPlugins = array_map(function ($file) { |
|
| 119 | + $jsPlugins = array_map(function($file) { |
|
| 120 | 120 | return $file->getRealPath(); |
| 121 | 121 | }, iterator_to_array($finder->files())); |
| 122 | 122 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $scss = new Compiler(); |
| 148 | 148 | $scss->setIgnoreErrors(true); |
| 149 | 149 | $scss->addImportPath($applicationScssPath); |
| 150 | - $scss->addImportPath(function ($path) use ($projectDir) { |
|
| 150 | + $scss->addImportPath(function($path) use ($projectDir) { |
|
| 151 | 151 | //Check for tilde as this refers to the node_modules dir |
| 152 | 152 | if (strpos($path, '~') === 0) { |
| 153 | 153 | $path = str_replace( |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | [$uSec, $sec] = explode(' ', microtime()); |
| 27 | 27 | |
| 28 | - return ((float) $uSec + (float) $sec); |
|
| 28 | + return ((float)$uSec + (float)$sec); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | if ($opt['session']['check_referer']) { |
| 52 | 52 | if (isset($_SERVER['REFERER'])) { |
| 53 | 53 | // TODO fix the following if statement, seems corrupted |
| 54 | - if (stripos('http' + strstr($_SERVER['REFERER'], '://'), strtolower($opt['page']['absolute_http_url'])) !== 0 |
|
| 54 | + if (stripos('http' +strstr($_SERVER['REFERER'], '://'), strtolower($opt['page']['absolute_http_url'])) !== 0 |
|
| 55 | 55 | ) { |
| 56 | 56 | $this->createNewSession(); |
| 57 | 57 | } |
@@ -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 | } |
@@ -15,13 +15,13 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | use OcLegacy\Util\PasswordCrypt; |
| 17 | 17 | |
| 18 | -define('LOGIN_UNKNOWN_ERROR', -1); // unknown error occurred |
|
| 19 | -define('LOGIN_OK', 0); // login succeeded |
|
| 20 | -define('LOGIN_BADUSERPW', 1); // bad username or password |
|
| 21 | -define('LOGIN_TOOMUCHLOGINS', 2); // too many logins in short time |
|
| 22 | -define('LOGIN_USERNOTACTIVE', 3); // the userAccount locked |
|
| 18 | +define('LOGIN_UNKNOWN_ERROR', -1); // unknown error occurred |
|
| 19 | +define('LOGIN_OK', 0); // login succeeded |
|
| 20 | +define('LOGIN_BADUSERPW', 1); // bad username or password |
|
| 21 | +define('LOGIN_TOOMUCHLOGINS', 2); // too many logins in short time |
|
| 22 | +define('LOGIN_USERNOTACTIVE', 3); // the userAccount locked |
|
| 23 | 23 | define('LOGIN_EMPTY_USERPASSWORD', 4); // given username/password was empty |
| 24 | -define('LOGIN_LOGOUT_OK', 5); // logout was successful |
|
| 24 | +define('LOGIN_LOGOUT_OK', 5); // logout was successful |
|
| 25 | 25 | |
| 26 | 26 | // login times in seconds |
| 27 | 27 | define('LOGIN_TIME', 60 * 60); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | // TODO good input evaluation |
| 71 | 71 | if ($cookie->is_set('userid') && $cookie->is_set('username')) { |
| 72 | - $this->userid = (int) $cookie->get('userid'); |
|
| 72 | + $this->userid = (int)$cookie->get('userid'); |
|
| 73 | 73 | $this->username = $cookie->get('username'); |
| 74 | 74 | $this->permanent = (($cookie->get('permanent') + 0) == 1); |
| 75 | 75 | $this->lastlogin = $cookie->get('lastlogin'); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | public function pStoreCookie(): void |
| 101 | 101 | { |
| 102 | 102 | global $cookie; |
| 103 | - $cookie->set('userid', (int) $this->userid); |
|
| 103 | + $cookie->set('userid', (int)$this->userid); |
|
| 104 | 104 | $cookie->set('username', $this->username); |
| 105 | 105 | $cookie->set('permanent', ($this->permanent === true ? 1 : 0)); |
| 106 | 106 | $cookie->set('lastlogin', $this->lastlogin); |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | $rUser['user_id'], |
| 295 | 295 | ($permanent != false ? 1 : 0) |
| 296 | 296 | ); |
| 297 | - $this->userid = (int) $rUser['user_id']; |
|
| 297 | + $this->userid = (int)$rUser['user_id']; |
|
| 298 | 298 | $this->username = $rUser['username']; |
| 299 | 299 | $this->permanent = $permanent; |
| 300 | 300 | $this->lastlogin = date('Y-m-d H:i:s'); |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | ); |
| 341 | 341 | if ($rUser = sql_fetch_assoc($rs)) { |
| 342 | 342 | $this->username = $rUser['username']; |
| 343 | - $this->userid = (int) $rUser['user_id']; |
|
| 343 | + $this->userid = (int)$rUser['user_id']; |
|
| 344 | 344 | $this->admin = $rUser['admin']; |
| 345 | 345 | $this->verified = true; |
| 346 | 346 | sqlf("UPDATE `user` SET `user`.`last_login`=NOW() WHERE `user`.`user_id`='&1'", $this->userid); |
@@ -13,14 +13,14 @@ |
||
| 13 | 13 | |
| 14 | 14 | public function push_pos(&$pos): void |
| 15 | 15 | { |
| 16 | - $this->stack[count($this->stack)] =& $pos; |
|
| 17 | - $this->stack_ref =& $pos; |
|
| 16 | + $this->stack[count($this->stack)] = & $pos; |
|
| 17 | + $this->stack_ref = & $pos; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function pop_pos(): void |
| 21 | 21 | { |
| 22 | 22 | unset($this->stack[count($this->stack) - 1]); |
| 23 | - $this->stack_ref =& $this->stack[count($this->stack) - 1]; |
|
| 23 | + $this->stack_ref = & $this->stack[count($this->stack) - 1]; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | $opt['rootpath'] = __DIR__ . '/../'; |
| 12 | 12 | |
| 13 | 13 | spl_autoload_register( |
| 14 | - function ($className): void { |
|
| 14 | + function($className): void { |
|
| 15 | 15 | if (!preg_match('/^[\w]{1,}$/', $className)) { |
| 16 | 16 | return; |
| 17 | 17 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | // database placeholder |
| 108 | 108 | |
| 109 | 109 | // productive database with opencaching-tables |
| 110 | -$opt['db']['placeholder']['db'] = ''; // selected by default |
|
| 110 | +$opt['db']['placeholder']['db'] = ''; // selected by default |
|
| 111 | 111 | |
| 112 | 112 | // empty database for temporary table creation |
| 113 | 113 | $opt['db']['placeholder']['tmpdb'] = ''; |
@@ -121,14 +121,14 @@ discard block |
||
| 121 | 121 | $opt['system']['maillog']['syslog_db_user'] = ''; |
| 122 | 122 | $opt['system']['maillog']['syslog_db_password'] = ''; |
| 123 | 123 | $opt['system']['maillog']['syslog_db_table'] = ''; |
| 124 | -$opt['system']['maillog']['syslog_oc_host'] = ''; // 'host_name' column in syslog DB |
|
| 125 | -$opt['system']['maillog']['syslog_mta'] = 'postfix/smtp%'; // 'program' column in syslog DB |
|
| 126 | -$opt['system']['maillog']['column']['id'] = 'id'; // 'ID' |
|
| 127 | -$opt['system']['maillog']['column']['created'] = 'created'; // 'ReceivedAt' |
|
| 124 | +$opt['system']['maillog']['syslog_oc_host'] = ''; // 'host_name' column in syslog DB |
|
| 125 | +$opt['system']['maillog']['syslog_mta'] = 'postfix/smtp%'; // 'program' column in syslog DB |
|
| 126 | +$opt['system']['maillog']['column']['id'] = 'id'; // 'ID' |
|
| 127 | +$opt['system']['maillog']['column']['created'] = 'created'; // 'ReceivedAt' |
|
| 128 | 128 | $opt['system']['maillog']['column']['host_name'] = 'host_name'; // 'FromHost' |
| 129 | -$opt['system']['maillog']['column']['message'] = 'message'; // 'Message' |
|
| 130 | -$opt['system']['maillog']['column']['program'] = 'program'; // 'SysLogTag' |
|
| 131 | -$opt['system']['maillog']['inactivity_warning'] = 30; // warn after N days without new entries |
|
| 129 | +$opt['system']['maillog']['column']['message'] = 'message'; // 'Message' |
|
| 130 | +$opt['system']['maillog']['column']['program'] = 'program'; // 'SysLogTag' |
|
| 131 | +$opt['system']['maillog']['inactivity_warning'] = 30; // warn after N days without new entries |
|
| 132 | 132 | |
| 133 | 133 | /* cookie or session |
| 134 | 134 | * |
@@ -150,15 +150,15 @@ discard block |
||
| 150 | 150 | * |
| 151 | 151 | * other parameters may be customized |
| 152 | 152 | */ |
| 153 | -$opt['session']['mode'] = SAVE_COOKIE; // don't change - other option "SAVE_SESSION" is not implemented properly |
|
| 153 | +$opt['session']['mode'] = SAVE_COOKIE; // don't change - other option "SAVE_SESSION" is not implemented properly |
|
| 154 | 154 | $opt['session']['cookiename'] = 'ocdevelopment'; // only with SAVE_COOKIE |
| 155 | 155 | $opt['session']['path'] = '/'; |
| 156 | -$opt['session']['domain'] = ''; // may be overwritten by $opt['domain'][...]['cookiedomain'] |
|
| 156 | +$opt['session']['domain'] = ''; // may be overwritten by $opt['domain'][...]['cookiedomain'] |
|
| 157 | 157 | |
| 158 | 158 | /* maximum session lifetime |
| 159 | 159 | */ |
| 160 | 160 | $opt['session']['expire']['cookie'] = 31536000; // when cookies used (default 1 year) |
| 161 | -$opt['session']['expire']['url'] = 1800; // when no cookies used (default 30 min since last call), attention to session.js |
|
| 161 | +$opt['session']['expire']['url'] = 1800; // when no cookies used (default 30 min since last call), attention to session.js |
|
| 162 | 162 | |
| 163 | 163 | /* If the Referer was sent by the client and the substring was not found, |
| 164 | 164 | * the embedded session id will be marked as invalid. |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | /* other template options |
| 185 | 185 | * |
| 186 | 186 | */ |
| 187 | -$opt['page']['origin_url'] = 'https://www.opencaching.de/'; // production installation for this OC site |
|
| 187 | +$opt['page']['origin_url'] = 'https://www.opencaching.de/'; // production installation for this OC site |
|
| 188 | 188 | $opt['page']['develsystem'] = false; |
| 189 | 189 | $opt['page']['teampic_url'] = 'https://www.opencaching.de/images/team/'; |
| 190 | 190 | $opt['page']['teammember_url'] = 'https://www.opencaching.de/'; |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | 'newcaches' => [ |
| 219 | 219 | 'show' => true, |
| 220 | 220 | 'url' => 'https://www.opencaching.de', |
| 221 | - 'urlname' => '', // optional: show other name than the url-domain |
|
| 221 | + 'urlname' => '', // optional: show other name than the url-domain |
|
| 222 | 222 | ], |
| 223 | 223 | ]; |
| 224 | 224 | |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | |
| 379 | 379 | /* license-related functions |
| 380 | 380 | */ |
| 381 | -$opt['logic']['license']['newusers'] = 2; // see license constants in lib2/logic/const.inc.php |
|
| 381 | +$opt['logic']['license']['newusers'] = 2; // see license constants in lib2/logic/const.inc.php |
|
| 382 | 382 | $opt['logic']['license']['admin'] = true; |
| 383 | 383 | $opt['logic']['license']['disclaimer'] = false; |
| 384 | 384 | $opt['logic']['license']['terms'] = 'articles.php?page=impressum#datalicense'; |
@@ -386,18 +386,18 @@ discard block |
||
| 386 | 386 | |
| 387 | 387 | /* optional APIs |
| 388 | 388 | */ |
| 389 | -$opt['logic']['api']['email_problems']['key'] = ''; // must be set to enable |
|
| 390 | -$opt['logic']['api']['user_inactivity']['key'] = ''; // must be set to enable |
|
| 389 | +$opt['logic']['api']['email_problems']['key'] = ''; // must be set to enable |
|
| 390 | +$opt['logic']['api']['user_inactivity']['key'] = ''; // must be set to enable |
|
| 391 | 391 | |
| 392 | 392 | /* cache report info settings |
| 393 | 393 | */ |
| 394 | 394 | $opt['logic']['cache_reports']['delaydays'] = 2; |
| 395 | -$opt['logic']['cache_reports']['min_processperday'] = 5; // set to 0 to disable |
|
| 396 | -$opt['logic']['cache_reports']['max_processperday'] = 20; // set to 0 to disable |
|
| 395 | +$opt['logic']['cache_reports']['min_processperday'] = 5; // set to 0 to disable |
|
| 396 | +$opt['logic']['cache_reports']['max_processperday'] = 20; // set to 0 to disable |
|
| 397 | 397 | |
| 398 | 398 | /* cronjob |
| 399 | 399 | */ |
| 400 | -$opt['cron']['username'] = 'apache'; // system username for cronjobs |
|
| 400 | +$opt['cron']['username'] = 'apache'; // system username for cronjobs |
|
| 401 | 401 | |
| 402 | 402 | /* generate sitemap.xml and upload to search engines |
| 403 | 403 | * |
@@ -125,6 +125,6 @@ |
||
| 125 | 125 | */ |
| 126 | 126 | $expressionAst = (new ExpressionLanguage())->parse($violation->getPropertyPath(), [])->getNodes(); |
| 127 | 127 | |
| 128 | - return (int) $expressionAst->nodes['node']->nodes[1]->attributes['value']; |
|
| 128 | + return (int)$expressionAst->nodes['node']->nodes[1]->attributes['value']; |
|
| 129 | 129 | } |
| 130 | 130 | } |