@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | setEventMessages($langs->trans("CommentAdded"), null, 'mesgs'); |
50 | 50 | header('Location: '.$varpage.'?id='.$id.($withproject?'&withproject=1':'')); |
51 | 51 | exit; |
52 | - } |
|
53 | - else |
|
52 | + } else |
|
54 | 53 | { |
55 | 54 | setEventMessages($comment->error, $comment->errors,'errors'); |
56 | 55 | $action=''; |
@@ -66,8 +65,7 @@ discard block |
||
66 | 65 | setEventMessages($langs->trans("CommentDeleted"), null, 'mesgs'); |
67 | 66 | header('Location: '.$varpage.'?id='.$id.($withproject?'&withproject=1':'')); |
68 | 67 | exit; |
69 | - } |
|
70 | - else |
|
68 | + } else |
|
71 | 69 | { |
72 | 70 | setEventMessages($comment->error, $comment->errors,'errors'); |
73 | 71 | $action=''; |
@@ -90,15 +90,15 @@ discard block |
||
90 | 90 | */ |
91 | 91 | function SendError($number, $text) |
92 | 92 | { |
93 | - if ( $_GET['Command'] == 'FileUpload' ) |
|
94 | - SendUploadResults($number, "", "", $text); |
|
93 | + if ( $_GET['Command'] == 'FileUpload' ) { |
|
94 | + SendUploadResults($number, "", "", $text); |
|
95 | + } |
|
95 | 96 | |
96 | 97 | if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] ) |
97 | 98 | { |
98 | 99 | SendErrorNode($number, $text); |
99 | 100 | CreateXmlFooter(); |
100 | - } |
|
101 | - else |
|
101 | + } else |
|
102 | 102 | { |
103 | 103 | SetXmlHeaders(); |
104 | 104 | |
@@ -125,8 +125,9 @@ discard block |
||
125 | 125 | */ |
126 | 126 | function SendErrorNode($number, $text) |
127 | 127 | { |
128 | - if ($text) |
|
129 | - echo '<Error number="' . $number . '" text="' . htmlspecialchars($text) . '" />' ; |
|
130 | - else |
|
131 | - echo '<Error number="' . $number . '" />' ; |
|
132 | -} |
|
128 | + if ($text) { |
|
129 | + echo '<Error number="' . $number . '" text="' . htmlspecialchars($text) . '" />' ; |
|
130 | + } else { |
|
131 | + echo '<Error number="' . $number . '" />' ; |
|
132 | + } |
|
133 | + } |
@@ -30,8 +30,9 @@ discard block |
||
30 | 30 | require 'basexml.php'; |
31 | 31 | require 'commands.php'; |
32 | 32 | |
33 | -if ( !$Config['Enabled'] ) |
|
33 | +if ( !$Config['Enabled'] ) { |
|
34 | 34 | SendError(1, 'This connector is disabled. Please check the "editor/filemanager/connectors/php/config.php" file'); |
35 | +} |
|
35 | 36 | |
36 | 37 | DoResponse(); |
37 | 38 | |
@@ -45,8 +46,9 @@ discard block |
||
45 | 46 | if (!isset($_GET)) { |
46 | 47 | global $_GET; |
47 | 48 | } |
48 | - if ( !isset( $_GET['Command'] ) || !isset( $_GET['Type'] ) || !isset( $_GET['CurrentFolder'] ) ) |
|
49 | - return; |
|
49 | + if ( !isset( $_GET['Command'] ) || !isset( $_GET['Type'] ) || !isset( $_GET['CurrentFolder'] ) ) { |
|
50 | + return; |
|
51 | + } |
|
50 | 52 | |
51 | 53 | // Get the main request informaiton. |
52 | 54 | $sCommand = $_GET['Command'] ; |
@@ -59,8 +61,9 @@ discard block |
||
59 | 61 | SendError(1, 'The "' . $sCommand . '" command isn\'t allowed'); |
60 | 62 | } |
61 | 63 | // Check if it is an allowed type. |
62 | - if (! IsAllowedType($sResourceType)) |
|
63 | - SendError(1, 'Invalid type specified'); |
|
64 | + if (! IsAllowedType($sResourceType)) { |
|
65 | + SendError(1, 'Invalid type specified'); |
|
66 | + } |
|
64 | 67 | |
65 | 68 | // File Upload doesn't have to Return XML, so it must be intercepted before anything. |
66 | 69 | if ( $sCommand == 'FileUpload' ) |
@@ -41,8 +41,9 @@ discard block |
||
41 | 41 | |
42 | 42 | |
43 | 43 | // Check if this uploader has been enabled. |
44 | -if ( !$Config['Enabled'] ) |
|
44 | +if ( !$Config['Enabled'] ) { |
|
45 | 45 | SendUploadResults('1', '', '', 'This file uploader is disabled. Please check the "filemanagerdol/connectors/php/config.php" file'); |
46 | +} |
|
46 | 47 | |
47 | 48 | $sCommand = 'QuickUpload' ; |
48 | 49 | |
@@ -52,12 +53,14 @@ discard block |
||
52 | 53 | $sCurrentFolder = "/" ; |
53 | 54 | |
54 | 55 | // Is enabled the upload? |
55 | -if (! IsAllowedCommand($sCommand)) |
|
56 | +if (! IsAllowedCommand($sCommand)) { |
|
56 | 57 | SendUploadResults('1', '', '', 'The ""' . $sCommand . '"" command isn\'t allowed'); |
58 | +} |
|
57 | 59 | |
58 | 60 | // Check if it is an allowed type. |
59 | -if (! IsAllowedType($sType)) |
|
61 | +if (! IsAllowedType($sType)) { |
|
60 | 62 | SendUploadResults(1, '', '', 'Invalid type specified'); |
63 | +} |
|
61 | 64 | |
62 | 65 | |
63 | 66 | // @CHANGE |
@@ -44,11 +44,12 @@ discard block |
||
44 | 44 | { |
45 | 45 | global $Config ; |
46 | 46 | |
47 | - if ($sCommand == "QuickUpload") |
|
48 | - return $Config['QuickUploadPath'][$resourceType] ; |
|
49 | - else |
|
50 | - return $Config['FileTypesPath'][$resourceType] ; |
|
51 | -} |
|
47 | + if ($sCommand == "QuickUpload") { |
|
48 | + return $Config['QuickUploadPath'][$resourceType] ; |
|
49 | + } else { |
|
50 | + return $Config['FileTypesPath'][$resourceType] ; |
|
51 | + } |
|
52 | + } |
|
52 | 53 | |
53 | 54 | /** |
54 | 55 | * GetResourceTypeDirectory |
@@ -62,16 +63,17 @@ discard block |
||
62 | 63 | global $Config ; |
63 | 64 | if ($sCommand == "QuickUpload") |
64 | 65 | { |
65 | - if ( strlen($Config['QuickUploadAbsolutePath'][$resourceType]) > 0) |
|
66 | - return $Config['QuickUploadAbsolutePath'][$resourceType] ; |
|
66 | + if ( strlen($Config['QuickUploadAbsolutePath'][$resourceType]) > 0) { |
|
67 | + return $Config['QuickUploadAbsolutePath'][$resourceType] ; |
|
68 | + } |
|
67 | 69 | |
68 | 70 | // Map the "UserFiles" path to a local directory. |
69 | 71 | return Server_MapPath($Config['QuickUploadPath'][$resourceType]); |
70 | - } |
|
71 | - else |
|
72 | + } else |
|
72 | 73 | { |
73 | - if ( strlen($Config['FileTypesAbsolutePath'][$resourceType]) > 0) |
|
74 | - return $Config['FileTypesAbsolutePath'][$resourceType] ; |
|
74 | + if ( strlen($Config['FileTypesAbsolutePath'][$resourceType]) > 0) { |
|
75 | + return $Config['FileTypesAbsolutePath'][$resourceType] ; |
|
76 | + } |
|
75 | 77 | |
76 | 78 | // Map the "UserFiles" path to a local directory. |
77 | 79 | return Server_MapPath($Config['FileTypesPath'][$resourceType]); |
@@ -116,8 +118,9 @@ discard block |
||
116 | 118 | |
117 | 119 | // Ensure that the directory exists. |
118 | 120 | $sErrorMsg = CreateServerFolder($sResourceTypePath); |
119 | - if ( $sErrorMsg != '' ) |
|
120 | - SendError(1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})"); |
|
121 | + if ( $sErrorMsg != '' ) { |
|
122 | + SendError(1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})"); |
|
123 | + } |
|
121 | 124 | |
122 | 125 | // Return the resource type directory combined with the required path. |
123 | 126 | return CombinePaths($sResourceTypePath, $folderPath); |
@@ -162,8 +165,9 @@ discard block |
||
162 | 165 | } |
163 | 166 | |
164 | 167 | $sErrorMsg = CreateServerFolder($sParent, $folderPath); |
165 | - if ( $sErrorMsg != '' ) |
|
166 | - return $sErrorMsg ; |
|
168 | + if ( $sErrorMsg != '' ) { |
|
169 | + return $sErrorMsg ; |
|
170 | + } |
|
167 | 171 | } |
168 | 172 | |
169 | 173 | if ( !file_exists($folderPath)) |
@@ -178,8 +182,7 @@ discard block |
||
178 | 182 | if ( isset( $Config['ChmodOnFolderCreate'] ) && !$Config['ChmodOnFolderCreate'] ) |
179 | 183 | { |
180 | 184 | mkdir($folderPath); |
181 | - } |
|
182 | - else |
|
185 | + } else |
|
183 | 186 | { |
184 | 187 | $permissions = '0777'; |
185 | 188 | if ( isset( $Config['ChmodOnFolderCreate'] ) && $Config['ChmodOnFolderCreate']) |
@@ -202,10 +205,10 @@ discard block |
||
202 | 205 | ini_restore('error_reporting'); |
203 | 206 | |
204 | 207 | return $sErrorMsg ; |
208 | + } else { |
|
209 | + return '' ; |
|
210 | + } |
|
205 | 211 | } |
206 | - else |
|
207 | - return '' ; |
|
208 | -} |
|
209 | 212 | |
210 | 213 | /** |
211 | 214 | * Get Root Path |
@@ -230,8 +233,9 @@ discard block |
||
230 | 233 | |
231 | 234 | // This can check only that this script isn't run from a virtual dir |
232 | 235 | // But it avoids the problems that arise if it isn't checked |
233 | - if ( $position === false || $position <> strlen($sRealPath) - strlen($sSelfPath) ) |
|
234 | - SendError(1, 'Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.php".'); |
|
236 | + if ( $position === false || $position <> strlen($sRealPath) - strlen($sSelfPath) ) { |
|
237 | + SendError(1, 'Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.php".'); |
|
238 | + } |
|
235 | 239 | |
236 | 240 | return substr($sRealPath, 0, $position); |
237 | 241 | } |
@@ -265,11 +269,13 @@ discard block |
||
265 | 269 | $arAllowed = $Config['AllowedExtensions'][$resourceType] ; |
266 | 270 | $arDenied = $Config['DeniedExtensions'][$resourceType] ; |
267 | 271 | |
268 | - if ( count($arAllowed) > 0 && !in_array($sExtension, $arAllowed)) |
|
269 | - return false ; |
|
272 | + if ( count($arAllowed) > 0 && !in_array($sExtension, $arAllowed)) { |
|
273 | + return false ; |
|
274 | + } |
|
270 | 275 | |
271 | - if ( count($arDenied) > 0 && in_array($sExtension, $arDenied)) |
|
272 | - return false ; |
|
276 | + if ( count($arDenied) > 0 && in_array($sExtension, $arDenied)) { |
|
277 | + return false ; |
|
278 | + } |
|
273 | 279 | |
274 | 280 | return true ; |
275 | 281 | } |
@@ -283,8 +289,9 @@ discard block |
||
283 | 289 | function IsAllowedType($resourceType) |
284 | 290 | { |
285 | 291 | global $Config ; |
286 | - if ( !in_array($resourceType, $Config['ConfigAllowedTypes'])) |
|
287 | - return false ; |
|
292 | + if ( !in_array($resourceType, $Config['ConfigAllowedTypes'])) { |
|
293 | + return false ; |
|
294 | + } |
|
288 | 295 | |
289 | 296 | return true ; |
290 | 297 | } |
@@ -299,8 +306,9 @@ discard block |
||
299 | 306 | { |
300 | 307 | global $Config ; |
301 | 308 | |
302 | - if (! in_array($sCommand, $Config['ConfigAllowedCommands'])) |
|
303 | - return false ; |
|
309 | + if (! in_array($sCommand, $Config['ConfigAllowedCommands'])) { |
|
310 | + return false ; |
|
311 | + } |
|
304 | 312 | |
305 | 313 | return true ; |
306 | 314 | } |
@@ -318,10 +326,12 @@ discard block |
||
318 | 326 | $sCurrentFolder = isset( $_GET['CurrentFolder'] ) ? GETPOST('CurrentFolder', '', 1) : '/' ; |
319 | 327 | |
320 | 328 | // Check the current folder syntax (must begin and start with a slash). |
321 | - if (!preg_match('|/$|', $sCurrentFolder)) |
|
322 | - $sCurrentFolder .= '/' ; |
|
323 | - if (strpos($sCurrentFolder, '/') !== 0) |
|
324 | - $sCurrentFolder = '/' . $sCurrentFolder ; |
|
329 | + if (!preg_match('|/$|', $sCurrentFolder)) { |
|
330 | + $sCurrentFolder .= '/' ; |
|
331 | + } |
|
332 | + if (strpos($sCurrentFolder, '/') !== 0) { |
|
333 | + $sCurrentFolder = '/' . $sCurrentFolder ; |
|
334 | + } |
|
325 | 335 | |
326 | 336 | // Ensure the folder path has no double-slashes |
327 | 337 | while ( strpos($sCurrentFolder, '//') !== false ) { |
@@ -329,11 +339,13 @@ discard block |
||
329 | 339 | } |
330 | 340 | |
331 | 341 | // Check for invalid folder paths (..) |
332 | - if ( strpos($sCurrentFolder, '..') || strpos($sCurrentFolder, "\\")) |
|
333 | - SendError(102, ''); |
|
342 | + if ( strpos($sCurrentFolder, '..') || strpos($sCurrentFolder, "\\")) { |
|
343 | + SendError(102, ''); |
|
344 | + } |
|
334 | 345 | |
335 | - if ( preg_match(",(/\.)|[[:cntrl:]]|(//)|(\\\\)|([\:\*\?\"\<\>\|]),", $sCurrentFolder)) |
|
336 | - SendError(102, ''); |
|
346 | + if ( preg_match(",(/\.)|[[:cntrl:]]|(//)|(\\\\)|([\:\*\?\"\<\>\|]),", $sCurrentFolder)) { |
|
347 | + SendError(102, ''); |
|
348 | + } |
|
337 | 349 | |
338 | 350 | return $sCurrentFolder ; |
339 | 351 | } |
@@ -357,8 +369,9 @@ discard block |
||
357 | 369 | $sNewFileName = stripslashes($sNewFileName); |
358 | 370 | |
359 | 371 | // Replace dots in the name with underscores (only one dot can be there... security issue). |
360 | - if ( $Config['ForceSingleExtension'] ) |
|
361 | - $sNewFileName = preg_replace('/\\.(?![^.]*$)/', '_', $sNewFileName); |
|
372 | + if ( $Config['ForceSingleExtension'] ) { |
|
373 | + $sNewFileName = preg_replace('/\\.(?![^.]*$)/', '_', $sNewFileName); |
|
374 | + } |
|
362 | 375 | |
363 | 376 | // Remove \ / | : ? * " < > |
364 | 377 | $sNewFileName = preg_replace('/\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[[:cntrl:]]/', '_', $sNewFileName); |
@@ -43,8 +43,9 @@ discard block |
||
43 | 43 | { |
44 | 44 | while ( $sFile = readdir($oCurrentFolder) ) |
45 | 45 | { |
46 | - if ( $sFile != '.' && $sFile != '..' && is_dir($sServerDir . $sFile) ) |
|
47 | - $aFolders[] = '<Folder name="' . ConvertToXmlAttribute($sFile) . '" />' ; |
|
46 | + if ( $sFile != '.' && $sFile != '..' && is_dir($sServerDir . $sFile) ) { |
|
47 | + $aFolders[] = '<Folder name="' . ConvertToXmlAttribute($sFile) . '" />' ; |
|
48 | + } |
|
48 | 49 | } |
49 | 50 | closedir($oCurrentFolder); |
50 | 51 | } |
@@ -53,8 +54,9 @@ discard block |
||
53 | 54 | echo "<Folders>" ; |
54 | 55 | |
55 | 56 | natcasesort($aFolders); |
56 | - foreach ( $aFolders as $sFolder ) |
|
57 | - echo $sFolder ; |
|
57 | + foreach ( $aFolders as $sFolder ) { |
|
58 | + echo $sFolder ; |
|
59 | + } |
|
58 | 60 | |
59 | 61 | // Close the "Folders" node. |
60 | 62 | echo "</Folders>" ; |
@@ -84,9 +86,9 @@ discard block |
||
84 | 86 | { |
85 | 87 | if ( $sFile != '.' && $sFile != '..' ) |
86 | 88 | { |
87 | - if ( is_dir($sServerDir . $sFile) ) |
|
88 | - $aFolders[] = '<Folder name="' . ConvertToXmlAttribute($sFile) . '" />' ; |
|
89 | - else |
|
89 | + if ( is_dir($sServerDir . $sFile) ) { |
|
90 | + $aFolders[] = '<Folder name="' . ConvertToXmlAttribute($sFile) . '" />' ; |
|
91 | + } else |
|
90 | 92 | { |
91 | 93 | $iFileSize = @filesize($sServerDir . $sFile); |
92 | 94 | if ( !$iFileSize ) { |
@@ -95,8 +97,9 @@ discard block |
||
95 | 97 | if ( $iFileSize > 0 ) |
96 | 98 | { |
97 | 99 | $iFileSize = round($iFileSize / 1024); |
98 | - if ( $iFileSize < 1 ) |
|
99 | - $iFileSize = 1 ; |
|
100 | + if ( $iFileSize < 1 ) { |
|
101 | + $iFileSize = 1 ; |
|
102 | + } |
|
100 | 103 | } |
101 | 104 | |
102 | 105 | $aFiles[] = '<File name="' . ConvertToXmlAttribute($sFile) . '" size="' . $iFileSize . '" />' ; |
@@ -110,8 +113,9 @@ discard block |
||
110 | 113 | natcasesort($aFolders); |
111 | 114 | echo '<Folders>' ; |
112 | 115 | |
113 | - foreach ( $aFolders as $sFolder ) |
|
114 | - echo $sFolder ; |
|
116 | + foreach ( $aFolders as $sFolder ) { |
|
117 | + echo $sFolder ; |
|
118 | + } |
|
115 | 119 | |
116 | 120 | echo '</Folders>' ; |
117 | 121 | |
@@ -119,8 +123,9 @@ discard block |
||
119 | 123 | natcasesort($aFiles); |
120 | 124 | echo '<Files>' ; |
121 | 125 | |
122 | - foreach ( $aFiles as $sFiles ) |
|
123 | - echo $sFiles ; |
|
126 | + foreach ( $aFiles as $sFiles ) { |
|
127 | + echo $sFiles ; |
|
128 | + } |
|
124 | 129 | |
125 | 130 | echo '</Files>' ; |
126 | 131 | } |
@@ -145,8 +150,10 @@ discard block |
||
145 | 150 | $sNewFolderName = $_GET['NewFolderName'] ; |
146 | 151 | $sNewFolderName = SanitizeFolderName($sNewFolderName); |
147 | 152 | |
148 | - if (strpos($sNewFolderName, '..') !== false) |
|
149 | - $sErrorNumber = '102' ; // Invalid folder name. |
|
153 | + if (strpos($sNewFolderName, '..') !== false) { |
|
154 | + $sErrorNumber = '102' ; |
|
155 | + } |
|
156 | + // Invalid folder name. |
|
150 | 157 | else |
151 | 158 | { |
152 | 159 | // Map the virtual path to the local server path of the current folder. |
@@ -171,13 +178,13 @@ discard block |
||
171 | 178 | $sErrorNumber = '110' ; |
172 | 179 | break ; |
173 | 180 | } |
181 | + } else { |
|
182 | + $sErrorNumber = '103' ; |
|
174 | 183 | } |
175 | - else |
|
176 | - $sErrorNumber = '103' ; |
|
177 | 184 | } |
185 | + } else { |
|
186 | + $sErrorNumber = '102' ; |
|
178 | 187 | } |
179 | - else |
|
180 | - $sErrorNumber = '102' ; |
|
181 | 188 | |
182 | 189 | // Create the "Error" node. |
183 | 190 | echo '<Error number="' . $sErrorNumber . '" />' ; |
@@ -254,8 +261,7 @@ discard block |
||
254 | 261 | $iCounter++ ; |
255 | 262 | $sFileName = RemoveExtension($sOriginalFileName) . '(' . $iCounter . ').' . $sExtension ; |
256 | 263 | $sErrorNumber = '201' ; |
257 | - } |
|
258 | - else |
|
264 | + } else |
|
259 | 265 | { |
260 | 266 | move_uploaded_file($oFile['tmp_name'], $sFilePath); |
261 | 267 | |
@@ -289,19 +295,18 @@ discard block |
||
289 | 295 | { |
290 | 296 | @unlink($sFilePath); |
291 | 297 | $sErrorNumber = '202' ; |
292 | - } |
|
293 | - else if ( isset( $detectHtml ) && $detectHtml === -1 && DetectHtml($sFilePath) === true ) |
|
298 | + } else if ( isset( $detectHtml ) && $detectHtml === -1 && DetectHtml($sFilePath) === true ) |
|
294 | 299 | { |
295 | 300 | @unlink($sFilePath); |
296 | 301 | $sErrorNumber = '202' ; |
297 | 302 | } |
298 | 303 | } |
304 | + } else { |
|
305 | + $sErrorNumber = '202' ; |
|
299 | 306 | } |
300 | - else |
|
307 | + } else { |
|
301 | 308 | $sErrorNumber = '202' ; |
302 | 309 | } |
303 | - else |
|
304 | - $sErrorNumber = '202' ; |
|
305 | 310 | |
306 | 311 | |
307 | 312 | $sFileUrl = CombinePaths(GetResourceTypePath($resourceType, $sCommand), $currentFolder); |
@@ -314,8 +319,7 @@ discard block |
||
314 | 319 | { |
315 | 320 | // this line already exists so wrap the if block around it |
316 | 321 | SendUploadResults($sErrorNumber, $sFileUrl, $sFileName); |
317 | - } |
|
318 | - else |
|
322 | + } else |
|
319 | 323 | { |
320 | 324 | //issue the CKEditor Callback |
321 | 325 | SendCKEditorResults( |
@@ -34,7 +34,10 @@ discard block |
||
34 | 34 | require_once '../../../../main.inc.php'; |
35 | 35 | $uri=preg_replace('/^http(s?):\/\//i','',$dolibarr_main_url_root); |
36 | 36 | $pos = strstr($uri, '/'); // $pos contient alors url sans nom domaine |
37 | -if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a '' |
|
37 | +if ($pos == '/') { |
|
38 | + $pos = ''; |
|
39 | +} |
|
40 | +// si $pos vaut /, on le met a '' |
|
38 | 41 | define('DOL_URL_ROOT', $pos); |
39 | 42 | $entity = ((!empty($_SESSION['dol_entity']) && $_SESSION['dol_entity'] > 1) ? $_SESSION['dol_entity'] : null); |
40 | 43 | |
@@ -81,14 +84,18 @@ discard block |
||
81 | 84 | // Set to 0 to disable this feature. |
82 | 85 | // Note: not needed on Windows-based servers. |
83 | 86 | $newmask = '0644'; |
84 | -if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; |
|
87 | +if (! empty($conf->global->MAIN_UMASK)) { |
|
88 | + $newmask=$conf->global->MAIN_UMASK; |
|
89 | +} |
|
85 | 90 | $Config['ChmodOnUpload'] = $newmask; |
86 | 91 | |
87 | 92 | // See comments above. |
88 | 93 | // Used when creating folders that does not exist. |
89 | 94 | $newmask = '0755'; |
90 | 95 | $dirmaskdec=octdec($newmask); |
91 | -if (! empty($conf->global->MAIN_UMASK)) $dirmaskdec=octdec($conf->global->MAIN_UMASK); |
|
96 | +if (! empty($conf->global->MAIN_UMASK)) { |
|
97 | + $dirmaskdec=octdec($conf->global->MAIN_UMASK); |
|
98 | +} |
|
92 | 99 | $dirmaskdec |= octdec('0200'); // Set w bit required to be able to create content for recursive subdirs files |
93 | 100 | $newmask = decoct($dirmaskdec); |
94 | 101 |
@@ -87,8 +87,7 @@ discard block |
||
87 | 87 | if ( defined('PHP_OS') ) |
88 | 88 | { |
89 | 89 | $os = PHP_OS ; |
90 | - } |
|
91 | - else |
|
90 | + } else |
|
92 | 91 | { |
93 | 92 | $os = php_uname(); |
94 | 93 | } |
@@ -96,8 +95,7 @@ discard block |
||
96 | 95 | if (strtoupper(substr($os, 0, 3)) === 'WIN' || FindBadUtf8($value)) |
97 | 96 | { |
98 | 97 | return (utf8_encode(htmlspecialchars($value))); |
99 | - } |
|
100 | - else |
|
98 | + } else |
|
101 | 99 | { |
102 | 100 | return (htmlspecialchars($value)); |
103 | 101 | } |
@@ -36,7 +36,9 @@ |
||
36 | 36 | { |
37 | 37 | global $langs; |
38 | 38 | |
39 | - if (empty($maxstep)) $maxstep=6; |
|
39 | + if (empty($maxstep)) { |
|
40 | + $maxstep=6; |
|
41 | + } |
|
40 | 42 | |
41 | 43 | $h=0; |
42 | 44 | $head = array(); |