Passed
Push — wip_sessions ( 2e0cc8...014f47 )
by Nils
05:41
created
api/Model/UserModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
  *
22 22
  * @see       https://www.teampass.net
23 23
  */
24
-require_once API_ROOT_PATH . "/Model/Database.php";
24
+require_once API_ROOT_PATH."/Model/Database.php";
25 25
 
26 26
 class UserModel extends Database
27 27
 {
Please login to merge, or discard this patch.
api/Controller/Api/ItemController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             // SQL where clause with folders list
53 53
             if (isset($arrQueryStringParams['folders']) === true) {
54 54
                 // convert the folders to an array
55
-                $arrQueryStringParams['folders'] = explode(',', str_replace( array('[',']') , ''  , $arrQueryStringParams['folders']));
55
+                $arrQueryStringParams['folders'] = explode(',', str_replace(array('[', ']'), '', $arrQueryStringParams['folders']));
56 56
 
57 57
                 // ensure to only use the intersection
58 58
                 $foldersList = implode(',', array_intersect($arrQueryStringParams['folders'], $userData['folders_list']));
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
             // SQL where clause with item id
127 127
             if (isset($arrQueryStringParams['id']) === true) {
128 128
                 // build sql where clause by ID
129
-                $sqlExtra = ' WHERE i.id = '.$arrQueryStringParams['id'] . $sql_constraint;
129
+                $sqlExtra = ' WHERE i.id = '.$arrQueryStringParams['id'].$sql_constraint;
130 130
             } else if (isset($arrQueryStringParams['label']) === true) {
131 131
                 // build sql where clause by LABEL
132
-                $sqlExtra = ' WHERE i.label '.(isset($arrQueryStringParams['like']) === true && (int) $arrQueryStringParams['like'] === 1 ? ' LIKE '.$arrQueryStringParams['label'] : ' = '.$arrQueryStringParams['label']) . $sql_constraint;
132
+                $sqlExtra = ' WHERE i.label '.(isset($arrQueryStringParams['like']) === true && (int) $arrQueryStringParams['like'] === 1 ? ' LIKE '.$arrQueryStringParams['label'] : ' = '.$arrQueryStringParams['label']).$sql_constraint;
133 133
             } else if (isset($arrQueryStringParams['description']) === true) {
134 134
                 // build sql where clause by LABEL
135 135
                 $sqlExtra = ' WHERE i.description '.(isset($arrQueryStringParams['like']) === true && (int) $arrQueryStringParams['like'] === 1 ? ' LIKE '.$arrQueryStringParams['description'] : ' = '.$arrQueryStringParams['description']).$sql_constraint;
Please login to merge, or discard this patch.
api/Controller/Api/FolderController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
                     $arrFolders = $folderModel->getFoldersInfo(explode(",", $userData['folders_list']));
51 51
                     $responseData = json_encode($arrFolders);
52 52
                 } catch (Error $e) {
53
-                    $strErrorDesc = $e->getMessage() . ' Something went wrong! Please contact support.';
53
+                    $strErrorDesc = $e->getMessage().' Something went wrong! Please contact support.';
54 54
                     $strErrorHeader = 'HTTP/1.1 500 Internal Server Error';
55 55
                 }
56 56
             }
Please login to merge, or discard this patch.
api/Model/FolderModel.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
  *
23 23
  * @see       https://www.teampass.net
24 24
  */
25
-require_once API_ROOT_PATH . "/Model/Database.php";
25
+require_once API_ROOT_PATH."/Model/Database.php";
26 26
  
27 27
 class FolderModel extends Database
28 28
 {
29 29
     public function getFoldersInfo(array $foldersId): array
30 30
     {
31
-        $rows = $this->select( "SELECT id, title FROM " . prefixTable('nested_tree') . " WHERE nlevel=1" );
31
+        $rows = $this->select("SELECT id, title FROM ".prefixTable('nested_tree')." WHERE nlevel=1");
32 32
 
33 33
         $ret = [];
34 34
 
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
     private function getFoldersChildren(int $parentId, array $foldersId): array
56 56
     {
57 57
         $ret = [];
58
-        $childrens = $this->select('SELECT id, title FROM ' . prefixTable('nested_tree') . ' WHERE parent_id=' . $parentId);
58
+        $childrens = $this->select('SELECT id, title FROM '.prefixTable('nested_tree').' WHERE parent_id='.$parentId);
59 59
 
60
-        if ( count($childrens) > 0) {
60
+        if (count($childrens) > 0) {
61 61
             foreach ($childrens as $children) {
62 62
 				$isVisible = in_array((int) $children['id'], $foldersId);
63 63
                 $childs = $this->getFoldersChildren($children['id'], $foldersId);
Please login to merge, or discard this patch.
scripts/background_tasks___sending_emails.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 DB::debugmode(false);
64 64
 $rows = DB::query(
65 65
     'SELECT *
66
-    FROM ' . prefixTable('processes') . '
66
+    FROM ' . prefixTable('processes').'
67 67
     WHERE is_in_progress = %i AND process_type = %s
68 68
     ORDER BY increment_id ASC LIMIT 0,10',
69 69
     0,
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 {
119 119
     //if ((int) $SETTINGS['enable_backlog_mail'] === 1) {
120 120
         $row = DB::queryFirstRow(
121
-            'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s',
121
+            'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s',
122 122
             'cron',
123 123
             'sending_emails'
124 124
         );
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         if ((int) (time() - $row['valeur']) >= 300 || (int) $row['valeur'] === 0) {
127 127
             $rows = DB::query(
128 128
                 'SELECT *
129
-                FROM ' . prefixTable('emails') .
129
+                FROM ' . prefixTable('emails').
130 130
                 ' WHERE status != %s',
131 131
                 'sent'
132 132
             );
Please login to merge, or discard this patch.
scripts/task_maintenance_purge_old_files.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 function purgeTemporaryFiles(): void
72 72
 {
73 73
     // Load expected files
74
-    require_once __DIR__. '/../sources/main.functions.php';
75
-    include __DIR__. '/../includes/config/tp.config.php';
74
+    require_once __DIR__.'/../sources/main.functions.php';
75
+    include __DIR__.'/../includes/config/tp.config.php';
76 76
 
77 77
     if (isset($SETTINGS) === true) {
78 78
         //read folder
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
                 //delete file FILES
83 83
                 while (false !== ($f = readdir($dir))) {
84 84
                     if ($f !== '.' && $f !== '..' && $f !== '.htaccess') {
85
-                        if (file_exists($dir . $f) && ((time() - filectime($dir . $f)) > 604800)) {
86
-                            fileDelete($dir . '/' . $f, $SETTINGS);
85
+                        if (file_exists($dir.$f) && ((time() - filectime($dir.$f)) > 604800)) {
86
+                            fileDelete($dir.'/'.$f, $SETTINGS);
87 87
                         }
88 88
                     }
89 89
                 }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                 while (false !== ($f = readdir($dir))) {
103 103
                     if ($f !== '.' && $f !== '..') {
104 104
                         if (strpos($f, '_delete.') > 0) {
105
-                            fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $f, $SETTINGS);
105
+                            fileDelete($SETTINGS['path_to_upload_folder'].'/'.$f, $SETTINGS);
106 106
                         }
107 107
                     }
108 108
                 }
Please login to merge, or discard this patch.
scripts/task_maintenance_rebuild_config_file.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@
 block discarded – undo
72 72
 function rebuildConfigFile(): void
73 73
 {
74 74
     // Load expected files
75
-    require_once __DIR__. '/../sources/main.functions.php';
76
-    include __DIR__. '/../includes/config/tp.config.php';
75
+    require_once __DIR__.'/../sources/main.functions.php';
76
+    include __DIR__.'/../includes/config/tp.config.php';
77 77
 
78 78
     if (isset($SETTINGS) === true) {
79 79
         handleConfigFile('rebuild', $SETTINGS);
Please login to merge, or discard this patch.
api/Controller/Api/AuthController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $arrQueryStringParams = $this->getQueryStringParams();
40 40
 
41 41
         if (strtoupper($requestMethod) === 'POST') {
42
-            require API_ROOT_PATH . "/Model/AuthModel.php";
42
+            require API_ROOT_PATH."/Model/AuthModel.php";
43 43
             try {
44 44
                 $authModel = new AuthModel();
45 45
                 $arrUser = $authModel->getUserAuth(
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 if (array_key_exists("token", $arrUser)) {
51 51
                     $responseData = json_encode($arrUser);
52 52
                 } else {
53
-                    $strErrorDesc = $arrUser['error'] . " (" . $arrUser['info'] . ")";
53
+                    $strErrorDesc = $arrUser['error']." (".$arrUser['info'].")";
54 54
                     $strErrorHeader = 'HTTP/1.1 401 Unauthorized';
55 55
                 }
56 56
             } catch (Error $e) {
Please login to merge, or discard this patch.
includes/core/otv.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         WHERE code = %s',
77 77
         filter_input(INPUT_GET, 'code', FILTER_SANITIZE_FULL_SPECIAL_CHARS)
78 78
     );
79
-    if (DB::count() > 0  && (int) $data['timestamp'] === (int) filter_input(INPUT_GET, 'stamp', FILTER_VALIDATE_INT)) {
79
+    if (DB::count() > 0 && (int) $data['timestamp'] === (int) filter_input(INPUT_GET, 'stamp', FILTER_VALIDATE_INT)) {
80 80
         // otv is too old
81 81
         if ($data['time_limit'] < time() || ($data['views'] + 1) > $data['max_views']) {
82 82
             $html = 'Link is too old!';
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                 <tr><th>URL:</th><td>'.$url.'</td></tr>
180 180
                 </table></div>
181 181
                 <p class="mt-3 text-info"><i class="fas fa-info mr-2"></i>Copy carefully the data you need.<br>This page is visible until <b>'.
182
-                date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $dataItem['time_limit']).'</b> OR <b>'.($dataItem['max_views'] - ($dataItem['views']+1)).' more time(s)</b>.</div>
182
+                date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $dataItem['time_limit']).'</b> OR <b>'.($dataItem['max_views'] - ($dataItem['views'] + 1)).' more time(s)</b>.</div>
183 183
                 </div>';
184 184
             // log
185 185
             logItems(
Please login to merge, or discard this patch.