Passed
Push — GENERAL_BUG_REVIEW_240911 ( 3362b2...8cbbee )
by Rafael
49:13
created
public/htdocs/core/lib/invoice.lib.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             } else {
144 144
                 dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR);
145 145
             }
146
-            dol_setcache($cachekey, $nbEvent, 120);     // If setting cache fails, this is not a problem, so we do not test result.
146
+            dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
147 147
         }
148 148
 
149 149
         $head[$h][1] .= '/';
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             } else {
286 286
                 dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR);
287 287
             }
288
-            dol_setcache($cachekey, $nbEvent, 120);     // If setting cache fails, this is not a problem, so we do not test result.
288
+            dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
289 289
         }
290 290
 
291 291
         $head[$h][1] .= '/';
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
                 $dolgraph->setShowPercent(1);
454 454
                 $dolgraph->SetType(array('bars', 'bars', 'bars', 'bars', 'bars', 'bars'));
455 455
                 //$dolgraph->SetType(array('pie'));
456
-                $dolgraph->setHeight('160');    /* 160 min is required to show the 6 lines of legend */
456
+                $dolgraph->setHeight('160'); /* 160 min is required to show the 6 lines of legend */
457 457
                 $dolgraph->setWidth('450');
458 458
                 $dolgraph->setHideXValues(true);
459 459
                 if ($mode == 'customers') {
Please login to merge, or discard this patch.
public/htdocs/core/lib/files.lib.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             'types' => $types,
118 118
             'recursive' => $recursive,
119 119
             'filter' => $filter,
120
-            'excludefilter' => $exclude_array,  // Already converted to array.
120
+            'excludefilter' => $exclude_array, // Already converted to array.
121 121
             'sortcriteria' => $sortcriteria,
122 122
             'sortorder' => $sortorder,
123 123
             'loaddate' => $loaddate,
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
                 $qualified = 1;
153 153
 
154
-                $utf8_fullpathfile = "$utf8_path/$utf8_file";  // Temp variable for speed
154
+                $utf8_fullpathfile = "$utf8_path/$utf8_file"; // Temp variable for speed
155 155
 
156 156
                 // Check if file is qualified
157 157
                 foreach ($excludefilterarray as $filt) {
@@ -1955,7 +1955,7 @@  discard block
 block discarded – undo
1955 1955
                     $maxwidthmini = $tmparraysize['maxwidthmini'];
1956 1956
                     $maxheightmini = $tmparraysize['maxheightmini'];
1957 1957
                     //$quality = $tmparraysize['quality'];
1958
-                    $quality = 50;  // For thumbs, we force quality to 50
1958
+                    $quality = 50; // For thumbs, we force quality to 50
1959 1959
 
1960 1960
                     // Generate thumbs.
1961 1961
                     if ($generatethumbs) {
@@ -2383,9 +2383,9 @@  discard block
 block discarded – undo
2383 2383
                     // Skip directories (they would be added automatically)
2384 2384
                     if (!$file->isDir()) {
2385 2385
                         // Get real and relative path for current file
2386
-                        $filePath = $file->getPath();               // the full path with filename using the $inputdir root.
2386
+                        $filePath = $file->getPath(); // the full path with filename using the $inputdir root.
2387 2387
                         $fileName = $file->getFilename();
2388
-                        $fileFullRealPath = $file->getRealPath();   // the full path with name and transformed to use real path directory.
2388
+                        $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory.
2389 2389
 
2390 2390
                         //$relativePath = substr($fileFullRealPath, strlen($rootPath) + 1);
2391 2391
                         $relativePath = substr(($filePath ? $filePath . '/' : '') . $fileName, strlen($rootPath) + 1);
@@ -2656,9 +2656,9 @@  discard block
 block discarded – undo
2656 2656
                     // Skip directories (they would be added automatically)
2657 2657
                     if (!$file->isDir()) {
2658 2658
                         // Get real and relative path for current file
2659
-                        $filePath = $file->getPath();               // the full path with filename using the $inputdir root.
2659
+                        $filePath = $file->getPath(); // the full path with filename using the $inputdir root.
2660 2660
                         $fileName = $file->getFilename();
2661
-                        $fileFullRealPath = $file->getRealPath();   // the full path with name and transformed to use real path directory.
2661
+                        $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory.
2662 2662
 
2663 2663
                         //$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($fileFullRealPath, strlen($inputdir) + 1);
2664 2664
                         $relativePath = ($rootdirinzip ? $rootdirinzip . '/' : '') . substr(($filePath ? $filePath . '/' : '') . $fileName, strlen($inputdir) + 1);
Please login to merge, or discard this patch.
public/htdocs/core/lib/xcal.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
                     // the default behaviour but there is no way to change keeping old saved date compatible.
211 211
                     $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
212 212
                     // Local time should be used to prevent users in time zones earlier than GMT from being one day earlier
213
-                    $prefix     = ";VALUE=DATE";
213
+                    $prefix = ";VALUE=DATE";
214 214
                     if ($tzforfullday) {
215 215
                         $startdatef = dol_print_date($startdate, "dayxcard", 'gmt');
216 216
                     } else {
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
                 $enddatef = dol_print_date($enddate, "dayhourxcard", 'gmt');
239 239
 
240 240
                 if ($fulldayevent) {
241
-                    $prefix   = ";VALUE=DATE";
241
+                    $prefix = ";VALUE=DATE";
242 242
                     // We add 1 second so we reach the +1 day needed for full day event (DTEND must be next day after event)
243 243
                     // This is mention in https://datatracker.ietf.org/doc/html/rfc5545:
244 244
                     // "The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event."
Please login to merge, or discard this patch.
public/htdocs/core/lib/member.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@
 block discarded – undo
144 144
             } else {
145 145
                 dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR);
146 146
             }
147
-            dol_setcache($cachekey, $nbEvent, 120);     // If setting cache fails, this is not a problem, so we do not test result.
147
+            dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
148 148
         }
149 149
 
150 150
         $head[$h][1] .= '/';
Please login to merge, or discard this patch.
public/htdocs/core/lib/images.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@
 block discarded – undo
212 212
 
213 213
     $filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image
214 214
 
215
-    $infoImg = getimagesize($filetoread);           // Get data about src image
215
+    $infoImg = getimagesize($filetoread); // Get data about src image
216 216
     $imgWidth = $infoImg[0]; // Largeur de l'image
217 217
     $imgHeight = $infoImg[1]; // Hauteur de l'image
218 218
 
Please login to merge, or discard this patch.
public/htdocs/core/lib/oauth.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -283,7 +283,7 @@
 block discarded – undo
283 283
     // Supported OAUTH (a provider is supported when a file xxx_oauthcallback.php is available into htdocs/core/modules/oauth)
284 284
     $supportedoauth2array = array(
285 285
         'OAUTH_GOOGLE_NAME' => array(
286
-            'callbackfile' => 'google',     // used to generate the filename: google_oauthcallback.php
286
+            'callbackfile' => 'google', // used to generate the filename: google_oauthcallback.php
287 287
             'picto' => 'google',
288 288
             'urlforapp' => 'OAUTH_GOOGLE_DESC',
289 289
             'name' => 'Google',
Please login to merge, or discard this patch.
public/htdocs/core/lib/functions2.lib.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -2045,23 +2045,23 @@
 block discarded – undo
2045 2045
     //print extension_loaded('soap');
2046 2046
     if ($proxyuse) {
2047 2047
         $params = array('connection_timeout' => $timeout,
2048
-                      'response_timeout' => $response_timeout,
2049
-                      'proxy_use'      => 1,
2050
-                      'proxy_host'     => $proxyhost,
2051
-                      'proxy_port'     => $proxyport,
2052
-                      'proxy_login'    => $proxyuser,
2053
-                      'proxy_password' => $proxypass,
2054
-                      'trace'          => 1
2048
+                        'response_timeout' => $response_timeout,
2049
+                        'proxy_use'      => 1,
2050
+                        'proxy_host'     => $proxyhost,
2051
+                        'proxy_port'     => $proxyport,
2052
+                        'proxy_login'    => $proxyuser,
2053
+                        'proxy_password' => $proxypass,
2054
+                        'trace'          => 1
2055 2055
         );
2056 2056
     } else {
2057 2057
         $params = array('connection_timeout' => $timeout,
2058
-                      'response_timeout' => $response_timeout,
2059
-                      'proxy_use'      => 0,
2060
-                      'proxy_host'     => false,
2061
-                      'proxy_port'     => false,
2062
-                      'proxy_login'    => false,
2063
-                      'proxy_password' => false,
2064
-                      'trace'          => 1
2058
+                        'response_timeout' => $response_timeout,
2059
+                        'proxy_use'      => 0,
2060
+                        'proxy_host'     => false,
2061
+                        'proxy_port'     => false,
2062
+                        'proxy_login'    => false,
2063
+                        'proxy_password' => false,
2064
+                        'trace'          => 1
2065 2065
         );
2066 2066
     }
2067 2067
     return $params;
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     $main_dir = realpath(constant('BASE_PATH') . '/../Dolibarr/Modules');
91 91
 
92 92
     $modulesdir = array();
93
-    $modulesdir[$main_dir.'/'] = $main_dir.'/';
93
+    $modulesdir[$main_dir . '/'] = $main_dir . '/';
94 94
 
95 95
     foreach ($conf->file->dol_document_root as $type => $dirroot) {
96 96
         // Default core/modules dir
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         } else {
202 202
             print ': ';
203 203
         }
204
-        if (! empty($object->user_creation) && is_object($object->user_creation)) { // deprecated mode
204
+        if (!empty($object->user_creation) && is_object($object->user_creation)) { // deprecated mode
205 205
             if ($object->user_creation->id) {
206 206
                 print $object->user_creation->getNomUrl(-1, '', 0, 0, 0);
207 207
             } else {
@@ -2962,7 +2962,7 @@  discard block
 block discarded – undo
2962 2962
     $string = trim($string);
2963 2963
 
2964 2964
     // If string does not start and end with parenthesis, we return $string as is.
2965
-    if (! preg_match('/^\(.*\)$/', $string)) {
2965
+    if (!preg_match('/^\(.*\)$/', $string)) {
2966 2966
         return $string;
2967 2967
     }
2968 2968
 
@@ -3000,15 +3000,15 @@  discard block
 block discarded – undo
3000 3000
 function getArrayOfEmojiBis()
3001 3001
 {
3002 3002
     $arrayofcommonemoji = array(
3003
-        'misc' => array('2600', '26FF'),        // Miscellaneous Symbols
3004
-        'ding' => array('2700', '27BF'),        // Dingbats
3005
-        '????' => array('9989', '9989'),        // Variation Selectors
3006
-        'vars' => array('FE00', 'FE0F'),        // Variation Selectors
3007
-        'pict' => array('1F300', '1F5FF'),      // Miscellaneous Symbols and Pictographs
3008
-        'emot' => array('1F600', '1F64F'),      // Emoticons
3009
-        'tran' => array('1F680', '1F6FF'),      // Transport and Map Symbols
3010
-        'flag' => array('1F1E0', '1F1FF'),      // Flags (note: may be 1F1E6 instead of 1F1E0)
3011
-        'supp' => array('1F900', '1F9FF'),      // Supplemental Symbols and Pictographs
3003
+        'misc' => array('2600', '26FF'), // Miscellaneous Symbols
3004
+        'ding' => array('2700', '27BF'), // Dingbats
3005
+        '????' => array('9989', '9989'), // Variation Selectors
3006
+        'vars' => array('FE00', 'FE0F'), // Variation Selectors
3007
+        'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs
3008
+        'emot' => array('1F600', '1F64F'), // Emoticons
3009
+        'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols
3010
+        'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0)
3011
+        'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs
3012 3012
     );
3013 3013
 
3014 3014
     return $arrayofcommonemoji;
Please login to merge, or discard this patch.
public/htdocs/core/lib/bank.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -309,7 +309,7 @@
 block discarded – undo
309 309
     if ($account == null && $ibantocheck == null) {
310 310
         return false;
311 311
     } elseif ($ibantocheck == null) {
312
-        $ibantocheck = ($account->iban ? $account->iban : $account->iban_prefix);       // iban or iban_prefix for backward compatibility
312
+        $ibantocheck = ($account->iban ? $account->iban : $account->iban_prefix); // iban or iban_prefix for backward compatibility
313 313
     }
314 314
     //require_once constant('DOL_DOCUMENT_ROOT') . '/includes/php-iban/oophp-iban.php';
315 315
 
Please login to merge, or discard this patch.
public/htdocs/core/lib/security.lib.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         return bin2hex(random_bytes((int) floor($length / 2))); // the bin2hex will double the number of bytes so we take length / 2
107 107
     }
108 108
 
109
-    return bin2hex(openssl_random_pseudo_bytes((int) floor($length / 2)));      // the bin2hex will double the number of bytes so we take length / 2. May be very slow on Windows.
109
+    return bin2hex(openssl_random_pseudo_bytes((int) floor($length / 2))); // the bin2hex will double the number of bytes so we take length / 2. May be very slow on Windows.
110 110
 }
111 111
 
112 112
 /**
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 function dol_verifyHash($chain, $hash, $type = '0')
286 286
 {
287 287
     if ($type == '0' && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') == 'password_hash' && function_exists('password_verify')) {
288
-        if (! empty($hash[0]) && $hash[0] == '$') {
288
+        if (!empty($hash[0]) && $hash[0] == '$') {
289 289
             return password_verify($chain, $hash);
290 290
         } elseif (dol_strlen($hash) == 32) {
291 291
             return dol_verifyHash($chain, $hash, '3'); // md5
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
     } elseif ($type === 'crypt') {
340 340
         return '{CRYPT}' . crypt($password, $salt);
341 341
     } elseif ($type === 'clear') {
342
-        return '{CLEAR}' . $password;  // Just for test, plain text password is not secured !
342
+        return '{CLEAR}' . $password; // Just for test, plain text password is not secured !
343 343
     }
344 344
     return "";
345 345
 }
@@ -372,13 +372,13 @@  discard block
 block discarded – undo
372 372
     if (is_object($object)) {
373 373
         $objectid = $object->id;
374 374
     } else {
375
-        $objectid = $object;        // $objectid can be X or 'X,Y,Z'
375
+        $objectid = $object; // $objectid can be X or 'X,Y,Z'
376 376
     }
377 377
     if ($objectid == "-1") {
378 378
         $objectid = 0;
379 379
     }
380 380
     if ($objectid) {
381
-        $objectid = preg_replace('/[^0-9\.\,]/', '', (string) $objectid);   // For the case value is coming from a non sanitized user input
381
+        $objectid = preg_replace('/[^0-9\.\,]/', '', (string) $objectid); // For the case value is coming from a non sanitized user input
382 382
     }
383 383
 
384 384
     //dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
@@ -863,9 +863,9 @@  discard block
 block discarded – undo
863 863
     if (is_object($object)) {
864 864
         $objectid = $object->id;
865 865
     } else {
866
-        $objectid = $object;        // $objectid can be X or 'X,Y,Z'
866
+        $objectid = $object; // $objectid can be X or 'X,Y,Z'
867 867
     }
868
-    $objectid = preg_replace('/[^0-9\.\,]/', '', $objectid);    // For the case value is coming from a non sanitized user input
868
+    $objectid = preg_replace('/[^0-9\.\,]/', '', $objectid); // For the case value is coming from a non sanitized user input
869 869
 
870 870
     //dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
871 871
     //print "user_id=".$user->id.", features=".join(',', $featuresarray).", objectid=".$objectid;
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
         $checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
916 916
         $checkproject = array('projet', 'project'); // Test for project object
917 917
         $checktask = array('projet_task'); // Test for task object
918
-        $checkhierarchy = array('expensereport', 'holiday');    // check permission among the hierarchy of user
918
+        $checkhierarchy = array('expensereport', 'holiday'); // check permission among the hierarchy of user
919 919
         $checkuser = array('bookmark'); // check permission among the fk_user (must be myself or null)
920 920
         $nocheck = array('barcode', 'stock'); // No test
921 921
 
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
 
930 930
         // To avoid an access forbidden with a numeric ref
931 931
         if ($dbt_select != 'rowid' && $dbt_select != 'id') {
932
-            $objectid = "'" . $objectid . "'";  // Note: $objectid was already cast into int at begin of this method.
932
+            $objectid = "'" . $objectid . "'"; // Note: $objectid was already cast into int at begin of this method.
933 933
         }
934 934
         // Check permission for objectid on entity only
935 935
         if (in_array($feature, $check) && $objectid > 0) {      // For $objectid = 0, no check
Please login to merge, or discard this patch.