@@ -96,7 +96,7 @@ |
||
| 96 | 96 | // REDMINE-1249: Missing log text in mail notification |
| 97 | 97 | // simpler solution that converts html to text as the previous class html2text emptied the text completely |
| 98 | 98 | // implementation for line wrap, url's and probably more is missing |
| 99 | - $text = preg_replace( "/\n\s+/", "\n", rtrim(html_entity_decode(strip_tags($text)))); |
|
| 99 | + $text = preg_replace("/\n\s+/", "\n", rtrim(html_entity_decode(strip_tags($text)))); |
|
| 100 | 100 | |
| 101 | 101 | $text = str_replace( |
| 102 | 102 | [ |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | $fieldNoteService = AppKernel::Container()->get(FieldNoteService::class); |
| 51 | 51 | |
| 52 | 52 | $fieldNote = $fieldNoteService->fetchOneBy([ |
| 53 | - 'id' => (int) $_GET['fieldnoteid'], |
|
| 54 | - 'user_id' => (int) $user->getUserId() |
|
| 53 | + 'id' => (int)$_GET['fieldnoteid'], |
|
| 54 | + 'user_id' => (int)$user->getUserId() |
|
| 55 | 55 | ]); |
| 56 | 56 | |
| 57 | 57 | if ($fieldNote !== null) { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | // check if masslog warning is accepted (in cookie) |
| 98 | 98 | $masslogCookieSet = isset($_COOKIE['ocsuppressmasslogwarn']); |
| 99 | 99 | if ($masslogCookieSet) { |
| 100 | - $masslogCookieContent = (int) $_COOKIE['ocsuppressmasslogwarn']; |
|
| 100 | + $masslogCookieContent = (int)$_COOKIE['ocsuppressmasslogwarn']; |
|
| 101 | 101 | } else { |
| 102 | 102 | // save masslog acception in cookie that expires on midnight if clicked |
| 103 | 103 | if (isset($_REQUEST['suppressMasslogWarning']) && $_REQUEST['suppressMasslogWarning'] == 1) { |
@@ -109,17 +109,17 @@ discard block |
||
| 109 | 109 | // logtext, logtype, logday, logmonth, logyear |
| 110 | 110 | |
| 111 | 111 | $logText = isset($_POST['logtext']) ? trim($_POST['logtext']) : ''; |
| 112 | - $logType = isset($_REQUEST['logtype']) ? (int) $_REQUEST['logtype'] : null; |
|
| 112 | + $logType = isset($_REQUEST['logtype']) ? (int)$_REQUEST['logtype'] : null; |
|
| 113 | 113 | $logDateDay = isset($_POST['logday']) ? trim($_POST['logday']) : ($datesaved ? $defaultLogDay : date('d')); |
| 114 | 114 | $logDateMonth = isset($_POST['logmonth']) ? trim($_POST['logmonth']) : ($datesaved ? $defaultLogMonth : date('m')); |
| 115 | 115 | $logDateYear = isset($_POST['logyear']) ? trim($_POST['logyear']) : ($datesaved ? $defaultLogYear : date('Y')); |
| 116 | 116 | $logTimeHour = isset($_POST['loghour']) ? trim($_POST['loghour']) : ''; |
| 117 | 117 | $logTimeMinute = isset($_POST['logminute']) ? trim($_POST['logminute']) : ''; |
| 118 | - $needsMaintenance = isset($_POST['needs_maintenance2']) ? (int) $_POST['needs_maintenance2'] : (isset($_POST['needs_maintenance']) ? (int) $_POST['needs_maintenance'] : 0); |
|
| 119 | - $listingOutdated = isset($_POST['listing_outdated2']) ? (int) $_POST['listing_outdated2'] : (isset($_POST['listing_outdated']) ? (int) $_POST['listing_outdated'] : 0); |
|
| 120 | - $confirmListingOk = isset($_POST['confirm_listing_ok']) ? (int) $_POST['confirm_listing_ok'] : 0; |
|
| 121 | - $rateOption = isset($_POST['ratingoption']) ? (int) $_POST['ratingoption'] : 0; |
|
| 122 | - $rateCache = isset($_POST['rating']) ? (int) $_POST['rating'] : 0; |
|
| 118 | + $needsMaintenance = isset($_POST['needs_maintenance2']) ? (int)$_POST['needs_maintenance2'] : (isset($_POST['needs_maintenance']) ? (int)$_POST['needs_maintenance'] : 0); |
|
| 119 | + $listingOutdated = isset($_POST['listing_outdated2']) ? (int)$_POST['listing_outdated2'] : (isset($_POST['listing_outdated']) ? (int)$_POST['listing_outdated'] : 0); |
|
| 120 | + $confirmListingOk = isset($_POST['confirm_listing_ok']) ? (int)$_POST['confirm_listing_ok'] : 0; |
|
| 121 | + $rateOption = isset($_POST['ratingoption']) ? (int)$_POST['ratingoption'] : 0; |
|
| 122 | + $rateCache = isset($_POST['rating']) ? (int)$_POST['rating'] : 0; |
|
| 123 | 123 | $ocTeamComment = isset($_REQUEST['teamcomment']) ? $_REQUEST['teamcomment'] != 0 : 0; |
| 124 | 124 | $suppressMasslogWarning = isset($_REQUEST['suppressMasslogWarning']) ? $_REQUEST['suppressMasslogWarning'] : ($masslogCookieSet ? $masslogCookieContent : 0); |
| 125 | 125 | |
@@ -165,12 +165,12 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | // if not a found log, ignore the rating |
| 168 | - $rateOption = (int) ($logType == 1 || $logType == 7); |
|
| 168 | + $rateOption = (int)($logType == 1 || $logType == 7); |
|
| 169 | 169 | |
| 170 | 170 | // get log text editor mode (from form or from userprofile) |
| 171 | 171 | // 1 = text; 2 = HTML; 3 = tinyMCE |
| 172 | 172 | if (isset($_POST['descMode'])) { |
| 173 | - $descMode = (int) $_POST['descMode']; // Ocprop: 2 |
|
| 173 | + $descMode = (int)$_POST['descMode']; // Ocprop: 2 |
|
| 174 | 174 | if (($descMode < EditorConstants::HTML_MODE) || ($descMode > EditorConstants::EDITOR_MODE)) { |
| 175 | 175 | $descMode = EditorConstants::EDITOR_MODE; |
| 176 | 176 | } |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * set seconds 00:00:01, means "00:00 was logged" |
| 249 | 249 | * set seconds 00:00:00, means "no time was logged" |
| 250 | 250 | */ |
| 251 | - $logTimeSecond = (int) ($logTimeHour . $logTimeMinute != '' |
|
| 251 | + $logTimeSecond = (int)($logTimeHour . $logTimeMinute != '' |
|
| 252 | 252 | && $logTimeHour == 0 |
| 253 | 253 | && $logTimeMinute == 0); |
| 254 | 254 | |
@@ -256,8 +256,8 @@ discard block |
||
| 256 | 256 | $logDate = date( |
| 257 | 257 | $opt['db']['dateformat'], |
| 258 | 258 | mktime( |
| 259 | - (int) $logTimeHour, |
|
| 260 | - (int) $logTimeMinute, |
|
| 259 | + (int)$logTimeHour, |
|
| 260 | + (int)$logTimeMinute, |
|
| 261 | 261 | $logTimeSecond, |
| 262 | 262 | $logDateMonth, |
| 263 | 263 | $logDateDay, |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | if (isset($_REQUEST['fieldnoteid']) && $_REQUEST['fieldnoteid']) { |
| 309 | 309 | sql( |
| 310 | 310 | 'DELETE FROM field_note WHERE `id` = &1 AND `user_id` = &2', |
| 311 | - (int) $_REQUEST['fieldnoteid'], |
|
| 311 | + (int)$_REQUEST['fieldnoteid'], |
|
| 312 | 312 | $user->getUserId() |
| 313 | 313 | ); |
| 314 | 314 | |
@@ -395,8 +395,8 @@ discard block |
||
| 395 | 395 | |
| 396 | 396 | // prepare template and display |
| 397 | 397 | $tpl->assign('logtype_allows_nm', implode(',', $logtype_allows_nm)); |
| 398 | -$tpl->assign('scrollposx', isset($_REQUEST['scrollposx']) ? (int) $_REQUEST['scrollposx']: 0); |
|
| 399 | -$tpl->assign('scrollposy', isset($_REQUEST['scrollposy']) ? (int) $_REQUEST['scrollposy']: 0); |
|
| 398 | +$tpl->assign('scrollposx', isset($_REQUEST['scrollposx']) ? (int)$_REQUEST['scrollposx'] : 0); |
|
| 399 | +$tpl->assign('scrollposy', isset($_REQUEST['scrollposy']) ? (int)$_REQUEST['scrollposy'] : 0); |
|
| 400 | 400 | $tpl->assign('validate', $validate); |
| 401 | 401 | $tpl->assign('editlog', false); |
| 402 | 402 | |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | |
| 144 | 144 | // editor mode switching |
| 145 | 145 | if (isset($_POST['descMode'])) { |
| 146 | - $descMode = (int) $_POST['descMode']; // Ocprop: 2 |
|
| 146 | + $descMode = (int)$_POST['descMode']; // Ocprop: 2 |
|
| 147 | 147 | if (($descMode < EditorConstants::HTML_MODE) || ($descMode > EditorConstants::EDITOR_MODE)) { |
| 148 | 148 | $descMode = EditorConstants::EDITOR_MODE; |
| 149 | 149 | } |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | if (isset($_REQUEST['save'])) { |
| 100 | 100 | $purifier = new OcHTMLPurifier($opt); |
| 101 | 101 | $desctext = isset($_REQUEST['desctext']) ? $purifier->purify($_REQUEST['desctext']) : ""; |
| 102 | - $desc_htmledit = isset($_REQUEST['descMode']) && ((int) $_REQUEST['descMode']) == EditorConstants::HTML_MODE ? '0' : '1'; |
|
| 102 | + $desc_htmledit = isset($_REQUEST['descMode']) && ((int)$_REQUEST['descMode']) == EditorConstants::HTML_MODE ? '0' : '1'; |
|
| 103 | 103 | sql( |
| 104 | 104 | " |
| 105 | 105 | UPDATE `user` |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | isset($_REQUEST['desclang']) && |
| 25 | 25 | !isset($_REQUEST['descid'])) { // Ocprop |
| 26 | 26 | |
| 27 | - $cache_id = $_REQUEST['cacheid']; // Ocprop |
|
| 28 | - $desc_lang = $_REQUEST['desclang']; // Ocprop |
|
| 27 | + $cache_id = $_REQUEST['cacheid']; // Ocprop |
|
| 28 | + $desc_lang = $_REQUEST['desclang']; // Ocprop |
|
| 29 | 29 | |
| 30 | 30 | $rs = sql("SELECT `id` FROM `cache_desc` WHERE `cache_id`='&1' AND `language`='&2'", $cache_id, $desc_lang); |
| 31 | 31 | if (mysqli_num_rows($rs) == 1) { |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | //save to DB? |
| 93 | 93 | if (isset($_POST['post'])) { // Ocprop |
| 94 | 94 | //here we read all used information from the form if submitted |
| 95 | - $descMode = (int) $_POST['descMode'] ?? EditorConstants::EDITOR_MODE; // Ocprop |
|
| 95 | + $descMode = (int)$_POST['descMode'] ?? EditorConstants::EDITOR_MODE; // Ocprop |
|
| 96 | 96 | |
| 97 | 97 | switch ($descMode) { |
| 98 | 98 | case EditorConstants::HTML_MODE: |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $oldDescMode = $descMode; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - $short_desc = trim($_POST['short_desc']); // Ocprop |
|
| 118 | + $short_desc = trim($_POST['short_desc']); // Ocprop |
|
| 119 | 119 | $hint = htmlspecialchars(trim($_POST['hints']), ENT_COMPAT, 'UTF-8'); |
| 120 | 120 | $desclang = $_POST['desclang']; |
| 121 | 121 | $show_all_langs = isset($_POST['show_all_langs_value']) ? $_POST['show_all_langs_value'] : 0; |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | // Text from textarea |
| 133 | - $desc = trim($_POST['desc']); // Ocprop |
|
| 133 | + $desc = trim($_POST['desc']); // Ocprop |
|
| 134 | 134 | |
| 135 | 135 | // fuer alte Versionen von OCProp |
| 136 | 136 | if (isset($_POST['submit']) && !isset($_POST['version2'])) { |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | tpl_set_var('desclang', htmlspecialchars($desc_lang, ENT_COMPAT, 'UTF-8')); |
| 288 | 288 | tpl_set_var('desclang_name', htmlspecialchars(db_LanguageFromShort($desc_lang), ENT_COMPAT, 'UTF-8')); |
| 289 | 289 | tpl_set_var('cachename', htmlspecialchars($desc_record['name'], ENT_COMPAT, 'UTF-8')); |
| 290 | - tpl_set_var('reset', $reset); // obsolete |
|
| 290 | + tpl_set_var('reset', $reset); // obsolete |
|
| 291 | 291 | tpl_set_var('submit', $submit); |
| 292 | 292 | |
| 293 | 293 | // Text / normal HTML / HTML editor |
@@ -108,12 +108,12 @@ |
||
| 108 | 108 | // descMode auslesen, falls nicht gesetzt aus dem Profil laden |
| 109 | 109 | if (isset($_POST['descMode'])) { |
| 110 | 110 | // Ocprop |
| 111 | - $descMode = (int) $_POST['descMode']; |
|
| 111 | + $descMode = (int)$_POST['descMode']; |
|
| 112 | 112 | if (($descMode < EditorConstants::HTML_MODE) || ($descMode > EditorConstants::EDITOR_MODE)) { |
| 113 | 113 | $descMode = EditorConstants::EDITOR_MODE; |
| 114 | 114 | } |
| 115 | 115 | if (isset($_POST['oldDescMode'])) { |
| 116 | - $oldDescMode = (int) $_POST['oldDescMode']; |
|
| 116 | + $oldDescMode = (int)$_POST['oldDescMode']; |
|
| 117 | 117 | if (($oldDescMode < EditorConstants::HTML_MODE) || ($oldDescMode > EditorConstants::EDITOR_MODE)) { |
| 118 | 118 | $oldDescMode = $descMode; |
| 119 | 119 | } |
@@ -5,9 +5,9 @@ discard block |
||
| 5 | 5 | use Symfony\Component\ErrorHandler\Debug; |
| 6 | 6 | use Symfony\Component\HttpFoundation\Request; |
| 7 | 7 | |
| 8 | -require dirname(__DIR__).'/vendor/autoload.php'; |
|
| 8 | +require dirname(__DIR__) . '/vendor/autoload.php'; |
|
| 9 | 9 | |
| 10 | -(new Dotenv())->bootEnv(dirname(__DIR__).'/.env'); |
|
| 10 | +(new Dotenv())->bootEnv(dirname(__DIR__) . '/.env'); |
|
| 11 | 11 | |
| 12 | 12 | if ($_SERVER['APP_DEBUG']) { |
| 13 | 13 | umask(0000); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | Request::setTrustedHosts([$trustedHosts]); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | -$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); |
|
| 26 | +$kernel = new Kernel($_SERVER['APP_ENV'], (bool)$_SERVER['APP_DEBUG']); |
|
| 27 | 27 | $request = Request::createFromGlobals(); |
| 28 | 28 | $response = $kernel->handle($request); |
| 29 | 29 | $response->send(); |
@@ -14,19 +14,19 @@ |
||
| 14 | 14 | protected function configureContainer(ContainerConfigurator $container): void |
| 15 | 15 | { |
| 16 | 16 | $container->import('../config/{packages}/*.php'); |
| 17 | - $container->import('../config/{packages}/'.$this->environment.'/*.php'); |
|
| 17 | + $container->import('../config/{packages}/' . $this->environment . '/*.php'); |
|
| 18 | 18 | |
| 19 | - if (is_file($path = \dirname(__DIR__).'/config/services.php')) { |
|
| 19 | + if (is_file($path = \dirname(__DIR__) . '/config/services.php')) { |
|
| 20 | 20 | (require $path)($container->withPath($path), $this); |
| 21 | 21 | } |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | protected function configureRoutes(RoutingConfigurator $routes): void |
| 25 | 25 | { |
| 26 | - $routes->import('../config/{routes}/'.$this->environment.'/*.php'); |
|
| 26 | + $routes->import('../config/{routes}/' . $this->environment . '/*.php'); |
|
| 27 | 27 | $routes->import('../config/{routes}/*.php'); |
| 28 | 28 | |
| 29 | - if (is_file($path = \dirname(__DIR__).'/config/routes.php')) { |
|
| 29 | + if (is_file($path = \dirname(__DIR__) . '/config/routes.php')) { |
|
| 30 | 30 | (require $path)($routes->withPath($path), $this); |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | $records[] = $this->getEntityFromDatabaseArray($item); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - return array_map(static function ($role) {return $role->role;}, $records); |
|
| 135 | + return array_map(static function($role) {return $role->role; }, $records); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |