@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | use TeampassClasses\NestedTree\NestedTree; |
| 32 | 32 | use ZxcvbnPhp\Zxcvbn; |
| 33 | 33 | |
| 34 | -require_once API_ROOT_PATH . "/Model/Database.php"; |
|
| 34 | +require_once API_ROOT_PATH."/Model/Database.php"; |
|
| 35 | 35 | |
| 36 | 36 | class ItemModel extends Database |
| 37 | 37 | { |
@@ -53,16 +53,16 @@ discard block |
||
| 53 | 53 | "SELECT i.id, label, description, i.pw, i.url, i.id_tree, i.login, i.email, i.viewed_no, i.fa_icon, i.inactif, i.perso, t.title as folder_label |
| 54 | 54 | FROM ".prefixTable('items')." as i |
| 55 | 55 | LEFT JOIN ".prefixTable('nested_tree')." as t ON (t.id = i.id_tree) ". |
| 56 | - $sqlExtra . |
|
| 57 | - " ORDER BY i.id ASC" . |
|
| 56 | + $sqlExtra. |
|
| 57 | + " ORDER BY i.id ASC". |
|
| 58 | 58 | //($limit > 0 ? " LIMIT ?". ["i", $limit] : '') |
| 59 | - ($limit > 0 ? " LIMIT ". $limit : '') |
|
| 59 | + ($limit > 0 ? " LIMIT ".$limit : '') |
|
| 60 | 60 | ); |
| 61 | 61 | $ret = []; |
| 62 | 62 | foreach ($rows as $row) { |
| 63 | 63 | $userKey = $this->select( |
| 64 | 64 | 'SELECT share_key |
| 65 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 65 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 66 | 66 | WHERE user_id = '.$userId.' AND object_id = '.$row['id'] |
| 67 | 67 | ); |
| 68 | 68 | if (count($userKey) === 0 || empty($row['pw']) === true) { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | if (empty($path) === true) { |
| 98 | 98 | $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
| 99 | 99 | } else { |
| 100 | - $path .= '/' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 100 | + $path .= '/'.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | ) : array |
| 148 | 148 | { |
| 149 | 149 | try { |
| 150 | - include_once API_ROOT_PATH . '/../sources/main.functions.php'; |
|
| 151 | - include API_ROOT_PATH . '/../includes/config/tp.config.php'; |
|
| 150 | + include_once API_ROOT_PATH.'/../sources/main.functions.php'; |
|
| 151 | + include API_ROOT_PATH.'/../includes/config/tp.config.php'; |
|
| 152 | 152 | |
| 153 | 153 | // Step 1: Prepare data and sanitize inputs |
| 154 | 154 | $data = $this->prepareData($folderId, $label, $password, $description, $login, $email, $url, $tags, $anyone_can_modify, $icon); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | if (strlen($password) > $SETTINGS['pwd_maximum_length']) { |
| 270 | - throw new Exception('Password is too long (max allowed is ' . $SETTINGS['pwd_maximum_length'] . ' characters)'); |
|
| 270 | + throw new Exception('Password is too long (max allowed is '.$SETTINGS['pwd_maximum_length'].' characters)'); |
|
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | { |
| 281 | 281 | $dataFolderSettings = DB::queryFirstRow( |
| 282 | 282 | 'SELECT bloquer_creation, bloquer_modification, personal_folder |
| 283 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 283 | + FROM ' . prefixTable('nested_tree').' |
|
| 284 | 284 | WHERE id = %i', |
| 285 | 285 | $folderId |
| 286 | 286 | ); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | { |
| 304 | 304 | $folderComplexity = DB::queryFirstRow( |
| 305 | 305 | 'SELECT valeur |
| 306 | - FROM ' . prefixTable('misc') . ' |
|
| 306 | + FROM ' . prefixTable('misc').' |
|
| 307 | 307 | WHERE type = %s AND intitule = %i', |
| 308 | 308 | 'complex', |
| 309 | 309 | $itemInfos['folderId'] |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | private function checkForDuplicates(string $label, array $SETTINGS, array $itemInfos) : void |
| 332 | 332 | { |
| 333 | 333 | $existingItem = DB::queryFirstRow( |
| 334 | - 'SELECT * FROM ' . prefixTable('items') . ' |
|
| 334 | + 'SELECT * FROM '.prefixTable('items').' |
|
| 335 | 335 | WHERE label = %s AND inactif = %i', |
| 336 | 336 | $label, |
| 337 | 337 | 0 |