Passed
Push — master ( 492b54...49af33 )
by Alxarafe
25:44
created
Views/CategoriesIndexView.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
         $this->llxHeader('', $this->title, '', '', 0, 0, $arrayofjs, $arrayofcss);
111 111
 
112
-        $newcardbutton = '<a class="butActionNew" href="' . BASE_URI . '/categories/card.php?action=create&type=' . $this->type . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $this->type) . '"><span class="valignmiddle">' . Globals::$langs->trans("NewCategory") . '</span>';
112
+        $newcardbutton = '<a class="butActionNew" href="'.BASE_URI.'/categories/card.php?action=create&type='.$this->type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$this->type).'"><span class="valignmiddle">'.Globals::$langs->trans("NewCategory").'</span>';
113 113
         $newcardbutton .= '<span class="fa fa-plus-circle valignmiddle"></span>';
114 114
         $newcardbutton .= '</a>';
115 115
 
@@ -123,17 +123,17 @@  discard block
 block discarded – undo
123 123
         /*
124 124
          * Zone recherche produit/service
125 125
          */
126
-        print '<form method="post" action="index.php?type=' . $this->type . '">';
127
-        print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
128
-        print '<input type="hidden" name="type" value="' . $this->type . '">';
126
+        print '<form method="post" action="index.php?type='.$this->type.'">';
127
+        print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
128
+        print '<input type="hidden" name="type" value="'.$this->type.'">';
129 129
 
130 130
 
131 131
         print '<table class="noborder nohover" width="100%">';
132 132
         print '<tr class="liste_titre">';
133
-        print '<td colspan="3">' . Globals::$langs->trans("Search") . '</td>';
133
+        print '<td colspan="3">'.Globals::$langs->trans("Search").'</td>';
134 134
         print '</tr>';
135 135
         print '<tr class="oddeven"><td>';
136
-        print Globals::$langs->trans("Name") . ':</td><td><input class="flat inputsearch" type="text" name="catname" value="' . $catname . '"/></td><td><input type="submit" class="button" value="' . Globals::$langs->trans("Search") . '"></td></tr>';
136
+        print Globals::$langs->trans("Name").':</td><td><input class="flat inputsearch" type="text" name="catname" value="'.$catname.'"/></td><td><input type="submit" class="button" value="'.Globals::$langs->trans("Search").'"></td></tr>';
137 137
         /*
138 138
           // faire une rech dans une sous categorie uniquement
139 139
           print '<tr '.$bc[0].'><td>';
@@ -158,17 +158,17 @@  discard block
 block discarded – undo
158 158
             $cats = $categstatic->rechercher($id, $catname, $this->typetext);
159 159
 
160 160
             print '<table class="noborder" width="100%">';
161
-            print '<tr class="liste_titre"><td colspan="2">' . Globals::$langs->trans("FoundCats") . '</td></tr>';
161
+            print '<tr class="liste_titre"><td colspan="2">'.Globals::$langs->trans("FoundCats").'</td></tr>';
162 162
 
163 163
             foreach ($cats as $cat) {
164
-                print "\t" . '<tr class="oddeven">' . "\n";
164
+                print "\t".'<tr class="oddeven">'."\n";
165 165
                 print "\t\t<td>";
166 166
                 $categstatic->id = $cat->id;
167 167
                 $categstatic->ref = $cat->label;
168 168
                 $categstatic->label = $cat->label;
169 169
                 $categstatic->type = $cat->type;
170 170
                 $categstatic->color = $cat->color;
171
-                print '<span class="noborderoncategories" ' . ($categstatic->color ? ' style="background: #' . $categstatic->color . ';"' : ' style="background: #aaa"') . '>';
171
+                print '<span class="noborderoncategories" '.($categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>';
172 172
                 print $categstatic->getNomUrl(1, '');
173 173
                 print '</span>';
174 174
                 print "</td>\n";
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
             $data[] = array(
209 209
                 'rowid' => $val['rowid'],
210 210
                 'fk_menu' => $val['fk_parent'],
211
-                'entry' => '<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories" ' . ($categstatic->color ? ' style="background: #' . $categstatic->color . ';"' : ' style="background: #aaa"') . '>' . $li . '</span></td>' .
211
+                'entry' => '<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories" '.($categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>'.$li.'</span></td>'.
212 212
                 //'<td width="50%">'.dolGetFirstLineOfText($desc).'</td>'.
213
-                '<td align="right" width="20px;"><a href="' . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $val['id'] . '&type=' . $this->type . '">' . img_view() . '</a></td>' .
213
+                '<td align="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$this->type.'">'.img_view().'</a></td>'.
214 214
                 '</tr></table>'
215 215
             );
216 216
         }
@@ -219,9 +219,9 @@  discard block
 block discarded – undo
219 219
 //print_barre_liste('', 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, 0, '', 0, $newcardbutton, '', 0, 1, 1);
220 220
 
221 221
         print '<table class="liste nohover" width="100%">';
222
-        print '<tr class="liste_titre"><td>' . Globals::$langs->trans("Categories") . '</td><td></td><td align="right">';
222
+        print '<tr class="liste_titre"><td>'.Globals::$langs->trans("Categories").'</td><td></td><td align="right">';
223 223
         if (!empty($conf->use_javascript_ajax)) {
224
-            print '<div id="iddivjstreecontrol"><a class="notasortlink" href="#">' . img_picto('', 'object_category') . ' ' . Globals::$langs->trans("UndoExpandAll") . '</a> | <a class="notasortlink" href="#">' . img_picto('', 'object_category-expanded') . ' ' . Globals::$langs->trans("ExpandAll") . '</a></div>';
224
+            print '<div id="iddivjstreecontrol"><a class="notasortlink" href="#">'.img_picto('', 'object_category').' '.Globals::$langs->trans("UndoExpandAll").'</a> | <a class="notasortlink" href="#">'.img_picto('', 'object_category-expanded').' '.Globals::$langs->trans("ExpandAll").'</a></div>';
225 225
         }
226 226
         print '</td></tr>';
227 227
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
             print '</td></tr>';
234 234
         } else {
235 235
             print '<tr class="pair">';
236
-            print '<td colspan="3"><table class="nobordernopadding"><tr class="nobordernopadding"><td>' . DolUtils::img_picto_common('', 'treemenu/branchbottom.gif') . '</td>';
236
+            print '<td colspan="3"><table class="nobordernopadding"><tr class="nobordernopadding"><td>'.DolUtils::img_picto_common('', 'treemenu/branchbottom.gif').'</td>';
237 237
             print '<td valign="middle">';
238 238
             print Globals::$langs->trans("NoCategoryYet");
239 239
             print '</td>';
Please login to merge, or discard this patch.
Base/AlixarController.php 1 patch
Spacing   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
         // Note: the function dol_getprefix may have been redefined to return a different key to manage another area to protect.
51 51
         $prefix = DolUtils::dol_getprefix('');
52 52
 
53
-        $sessionname = 'DOLSESSID_' . $prefix;
54
-        $sessiontimeout = 'DOLSESSTIMEOUT_' . $prefix;
53
+        $sessionname = 'DOLSESSID_'.$prefix;
54
+        $sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix;
55 55
         if (!empty($_COOKIE[$sessiontimeout])) {
56 56
             ini_set('session.gc_maxlifetime', $_COOKIE[$sessiontimeout]);
57 57
         }
58 58
         session_name($sessionname);
59
-        session_set_cookie_params(0, '/', null, false, true);   // Add tag httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
59
+        session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
60 60
         // This create lock, released when session_write_close() or end of page.
61 61
         // We need this lock as long as we read/write $_SESSION ['vars']. We can remove lock when finished.
62 62
         if (!defined('NOSESSION')) {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             Globals::$conf->browser->name = $tmp['browsername'];
81 81
             Globals::$conf->browser->os = $tmp['browseros'];
82 82
             Globals::$conf->browser->version = $tmp['browserversion'];
83
-            Globals::$conf->browser->layout = $tmp['layout'];     // 'classic', 'phone', 'tablet'
83
+            Globals::$conf->browser->layout = $tmp['layout']; // 'classic', 'phone', 'tablet'
84 84
 //var_dump(Globals::$conf->browser);
85 85
 
86 86
             if (Globals::$conf->browser->layout == 'phone') {
@@ -101,18 +101,18 @@  discard block
 block discarded – undo
101 101
                         $newurl = preg_replace('/^http:/i', 'https:', $_SERVER["SCRIPT_URI"]);
102 102
                     }
103 103
                 } else { // Check HTTPS environment variable (Apache/mod_ssl only)
104
-                    $newurl = preg_replace('/^http:/i', 'https:', DOL_MAIN_URL_ROOT) . $_SERVER["REQUEST_URI"];
104
+                    $newurl = preg_replace('/^http:/i', 'https:', DOL_MAIN_URL_ROOT).$_SERVER["REQUEST_URI"];
105 105
                 }
106 106
             } else {
107 107
 // Check HTTPS environment variable (Apache/mod_ssl only)
108
-                $newurl = Globals::$conf->file->main_force_https . $_SERVER["REQUEST_URI"];
108
+                $newurl = Globals::$conf->file->main_force_https.$_SERVER["REQUEST_URI"];
109 109
             }
110 110
 // Start redirect
111 111
             if ($newurl) {
112
-                DolUtils::dol_syslog("main.inc: dolibarr_main_force_https is on, we make a redirect to " . $newurl);
112
+                DolUtils::dol_syslog("main.inc: dolibarr_main_force_https is on, we make a redirect to ".$newurl);
113 113
                 echo $newurl;
114 114
                 throw Exception('x');
115
-                header("Location: " . $newurl);
115
+                header("Location: ".$newurl);
116 116
                 exit;
117 117
             } else {
118 118
                 DolUtils::dol_syslog("main.inc: dolibarr_main_force_https is on but we failed to forge new https url so no redirect is done", LOG_WARNING);
@@ -137,29 +137,29 @@  discard block
 block discarded – undo
137 137
 
138 138
 // Loading of additional presentation includes
139 139
         if (!defined('NOREQUIREHTML')) {
140
-            require_once DOL_BASE_PATH . '/core/class/html.form.class.php';     // Need 660ko memory (800ko in 2.2)
140
+            require_once DOL_BASE_PATH.'/core/class/html.form.class.php'; // Need 660ko memory (800ko in 2.2)
141 141
         }
142 142
         if (!defined('NOREQUIREAJAX') && Globals::$conf->use_javascript_ajax) {
143
-            require_once DOL_BASE_PATH . '/core/lib/ajax.lib.php'; // Need 22ko memory
143
+            require_once DOL_BASE_PATH.'/core/lib/ajax.lib.php'; // Need 22ko memory
144 144
         }
145 145
 // If install or upgrade process not done or not completely finished, we call the install page.
146 146
         if (!empty(Globals::$conf->global->MAIN_NOT_INSTALLED) || !empty(Globals::$conf->global->MAIN_NOT_UPGRADED)) {
147 147
             DolUtils::dol_syslog("main.inc: A previous install or upgrade was not complete. Redirect to install page.", LOG_WARNING);
148 148
             throw Exception('x');
149
-            header("Location: " . DOL_BASE_URI . "/install/index.php");
149
+            header("Location: ".DOL_BASE_URI."/install/index.php");
150 150
             exit;
151 151
         }
152 152
 // If an upgrade process is required, we call the install page.
153 153
         if ((!empty(Globals::$conf->global->MAIN_VERSION_LAST_UPGRADE) && (Globals::$conf->global->MAIN_VERSION_LAST_UPGRADE != DOL_VERSION)) || (empty(Globals::$conf->global->MAIN_VERSION_LAST_UPGRADE) && !empty(Globals::$conf->global->MAIN_VERSION_LAST_INSTALL) && (Globals::$conf->global->MAIN_VERSION_LAST_INSTALL != DOL_VERSION))) {
154 154
             $versiontocompare = empty(Globals::$conf->global->MAIN_VERSION_LAST_UPGRADE) ? Globals::$conf->global->MAIN_VERSION_LAST_INSTALL : Globals::$conf->global->MAIN_VERSION_LAST_UPGRADE;
155
-            require_once DOL_BASE_PATH . '/core/lib/admin.lib.php';
155
+            require_once DOL_BASE_PATH.'/core/lib/admin.lib.php';
156 156
             $dolibarrversionlastupgrade = preg_split('/[.-]/', $versiontocompare);
157 157
             $dolibarrversionprogram = preg_split('/[.-]/', DOL_VERSION);
158 158
             $rescomp = versioncompare($dolibarrversionprogram, $dolibarrversionlastupgrade);
159 159
             if ($rescomp > 0) {   // Programs have a version higher than database. We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades
160
-                DolUtils::dol_syslog("main.inc: database version " . $versiontocompare . " is lower than programs version " . DOL_VERSION . ". Redirect to install page.", LOG_WARNING);
160
+                DolUtils::dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install page.", LOG_WARNING);
161 161
                 throw Exception('x');
162
-                header("Location: " . DOL_BASE_URI . "/install/index.php");
162
+                header("Location: ".DOL_BASE_URI."/install/index.php");
163 163
                 exit;
164 164
             }
165 165
         }
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
             }
184 184
             if ($_SERVER['REQUEST_METHOD'] === 'POST') {  // This test must be after loading $_SESSION['token'].
185 185
                 if (DolUtils::GETPOST('token', 'alpha') != $_SESSION['token']) {
186
-                    DolUtils::dol_syslog("Invalid token in " . $_SERVER['HTTP_REFERER'] . ", action=" . DolUtils::GETPOST('action', 'aZ09') . ", _POST['token']=" . DolUtils::GETPOST('token', 'alpha') . ", _SESSION['token']=" . $_SESSION['token'], LOG_WARNING);
186
+                    DolUtils::dol_syslog("Invalid token in ".$_SERVER['HTTP_REFERER'].", action=".DolUtils::GETPOST('action', 'aZ09').", _POST['token']=".DolUtils::GETPOST('token', 'alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING);
187 187
 //print 'Unset POST by CSRF protection in main.inc.php.';	// Do not output anything because this create problems when using the BACK button on browsers.
188 188
                     unset($_POST);
189 189
                 }
@@ -261,19 +261,19 @@  discard block
 block discarded – undo
261 261
                 $dol_use_jmobile = DolUtils::GETPOST('dol_use_jmobile', 'int', 3);
262 262
 //dol_syslog("POST key=".join(array_keys($_POST),',').' value='.join($_POST,','));
263 263
 // If in demo mode, we check we go to home page through the public/demo/index.php page
264
-                if (!empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_BASE_URI . '/index.php') {  // We ask index page
264
+                if (!empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_BASE_URI.'/index.php') {  // We ask index page
265 265
                     if (empty($_SERVER['HTTP_REFERER']) || !preg_match('/public/', $_SERVER['HTTP_REFERER'])) {
266
-                        DolUtils::dol_syslog("Call index page from another url than demo page (call is done from page " . $_SERVER['HTTP_REFERER'] . ")");
266
+                        DolUtils::dol_syslog("Call index page from another url than demo page (call is done from page ".$_SERVER['HTTP_REFERER'].")");
267 267
                         $url = '';
268
-                        $url .= ($url ? '&' : '') . ($dol_hide_topmenu ? 'dol_hide_topmenu=' . $dol_hide_topmenu : '');
269
-                        $url .= ($url ? '&' : '') . ($dol_hide_leftmenu ? 'dol_hide_leftmenu=' . $dol_hide_leftmenu : '');
270
-                        $url .= ($url ? '&' : '') . ($dol_optimize_smallscreen ? 'dol_optimize_smallscreen=' . $dol_optimize_smallscreen : '');
271
-                        $url .= ($url ? '&' : '') . ($dol_no_mouse_hover ? 'dol_no_mouse_hover=' . $dol_no_mouse_hover : '');
272
-                        $url .= ($url ? '&' : '') . ($dol_use_jmobile ? 'dol_use_jmobile=' . $dol_use_jmobile : '');
273
-                        $url = DOL_BASE_URI . '/public/demo/index.php' . ($url ? '?' . $url : '');
268
+                        $url .= ($url ? '&' : '').($dol_hide_topmenu ? 'dol_hide_topmenu='.$dol_hide_topmenu : '');
269
+                        $url .= ($url ? '&' : '').($dol_hide_leftmenu ? 'dol_hide_leftmenu='.$dol_hide_leftmenu : '');
270
+                        $url .= ($url ? '&' : '').($dol_optimize_smallscreen ? 'dol_optimize_smallscreen='.$dol_optimize_smallscreen : '');
271
+                        $url .= ($url ? '&' : '').($dol_no_mouse_hover ? 'dol_no_mouse_hover='.$dol_no_mouse_hover : '');
272
+                        $url .= ($url ? '&' : '').($dol_use_jmobile ? 'dol_use_jmobile='.$dol_use_jmobile : '');
273
+                        $url = DOL_BASE_URI.'/public/demo/index.php'.($url ? '?'.$url : '');
274 274
                         echo $url;
275 275
                         throw Exception('x');
276
-                        header("Location: " . $url);
276
+                        header("Location: ".$url);
277 277
                         exit;
278 278
                     }
279 279
                 }
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
                         $test = false;
294 294
 
295 295
 // Call trigger for the "security events" log
296
-                        Globals::$user->trigger_mesg = 'ErrorBadValueForCode - login=' . DolUtils::GETPOST("username", "alpha", 2);
296
+                        Globals::$user->trigger_mesg = 'ErrorBadValueForCode - login='.DolUtils::GETPOST("username", "alpha", 2);
297 297
 // Call of triggers
298 298
                         //include_once DOL_BASE_PATH . '/core/class/interfaces.class.php';
299 299
                         $interface = new Interfaces($db);
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                         $action = '';
307 307
                         Globals::$hookManager->initHooks(array('login'));
308 308
                         $parameters = array('dol_authmode' => $this->dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]);
309
-                        $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action);    // Note that $action and $object may have been modified by some hooks
309
+                        $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks
310 310
                         if ($reshook < 0)
311 311
                             $error++;
312 312
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
                         }
382 382
 
383 383
                         // Call trigger for the "security events" log
384
-                        Globals::$user->trigger_mesg = Globals::$langs->trans("ErrorBadLoginPassword") . ' - login=' . DolUtils::GETPOST("username", "alpha", 2);
384
+                        Globals::$user->trigger_mesg = Globals::$langs->trans("ErrorBadLoginPassword").' - login='.DolUtils::GETPOST("username", "alpha", 2);
385 385
 
386 386
                         // Call of triggers
387 387
                         //include_once DOL_BASE_PATH . '/core/class/interfaces.class.php';
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
                         $action = '';
396 396
                         Globals::$hookManager->initHooks(array('login'));
397 397
                         $parameters = array('dol_authmode' => $this->dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]);
398
-                        $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action);    // Note that $action and $object may have been modified by some hooks
398
+                        $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks
399 399
                         if ($reshook < 0) {
400 400
                             $error++;
401 401
                         }
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
                 // End test login / passwords
408 408
                 if (!$login || (in_array('ldap', $this->authmode) && empty($passwordtotest))) { // With LDAP we refused empty password because some LDAP are "opened" for anonymous access so connexion is a success.
409 409
                 // No data to test login, so we show the login page
410
-                    DolUtils::dol_syslog("--- Access to " . $_SERVER["PHP_SELF"] . " showing the login form and exit");
410
+                    DolUtils::dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." showing the login form and exit");
411 411
                     if (defined('NOREDIRECTBYMAINTOLOGIN')) {
412 412
                         return 'ERROR_NOT_LOGGED';
413 413
                     } else {
@@ -422,8 +422,8 @@  discard block
 block discarded – undo
422 422
                     DolUtils::dol_syslog('User not found, connexion refused');
423 423
                     session_destroy();
424 424
                     session_name($sessionname);
425
-                    session_set_cookie_params(0, '/', null, false, true);   // Add tag httponly on session cookie
426
-                    session_start();    // Fixing the bug of register_globals here is useless since session is empty
425
+                    session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie
426
+                    session_start(); // Fixing the bug of register_globals here is useless since session is empty
427 427
 
428 428
                     if ($resultFetchUser == 0) {
429 429
 // Load translation files required by page
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 
432 432
                         $_SESSION["dol_loginmesg"] = Globals::$langs->trans("ErrorCantLoadUserFromDolibarrDatabase", $login);
433 433
 
434
-                        Globals::$user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login=' . $login;
434
+                        Globals::$user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login='.$login;
435 435
                     }
436 436
                     if ($resultFetchUser < 0) {
437 437
                         $_SESSION["dol_loginmesg"] = Globals::$user->error;
@@ -451,40 +451,40 @@  discard block
 block discarded – undo
451 451
                     $action = '';
452 452
                     Globals::$hookManager->initHooks(array('login'));
453 453
                     $parameters = array('dol_authmode' => $this->dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]);
454
-                    $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action);    // Note that $action and $object may have been modified by some hooks
454
+                    $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks
455 455
                     if ($reshook < 0) {
456 456
                         $error++;
457 457
                     }
458 458
 
459 459
                     $paramsurl = array();
460 460
                     if (DolUtils::GETPOST('textbrowser', 'int')) {
461
-                        $paramsurl[] = 'textbrowser=' . DolUtils::GETPOST('textbrowser', 'int');
461
+                        $paramsurl[] = 'textbrowser='.DolUtils::GETPOST('textbrowser', 'int');
462 462
                     }
463 463
                     if (DolUtils::GETPOST('nojs', 'int')) {
464
-                        $paramsurl[] = 'nojs=' . DolUtils::GETPOST('nojs', 'int');
464
+                        $paramsurl[] = 'nojs='.DolUtils::GETPOST('nojs', 'int');
465 465
                     }
466 466
                     if (DolUtils::GETPOST('lang', 'aZ09')) {
467
-                        $paramsurl[] = 'lang=' . DolUtils::GETPOST('lang', 'aZ09');
467
+                        $paramsurl[] = 'lang='.DolUtils::GETPOST('lang', 'aZ09');
468 468
                     }
469
-                    echo 'Location: ' . DOL_BASE_URI . '/index.php' . (count($paramsurl) ? '?' . implode('&', $paramsurl) : '');
469
+                    echo 'Location: '.DOL_BASE_URI.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : '');
470 470
                     throw Exception('x');
471
-                    header('Location: ' . DOL_BASE_URI . '/index.php' . (count($paramsurl) ? '?' . implode('&', $paramsurl) : ''));
471
+                    header('Location: '.DOL_BASE_URI.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : ''));
472 472
                     exit;
473 473
                 }
474 474
             } else {
475 475
 // We are already into an authenticated session
476 476
                 $login = $_SESSION["dol_login"];
477 477
                 $entity = $_SESSION["dol_entity"];
478
-                DolUtils::dol_syslog("- This is an already logged session. _SESSION['dol_login']=" . $login . " _SESSION['dol_entity']=" . $entity, LOG_DEBUG);
478
+                DolUtils::dol_syslog("- This is an already logged session. _SESSION['dol_login']=".$login." _SESSION['dol_entity']=".$entity, LOG_DEBUG);
479 479
 
480 480
                 $resultFetchUser = Globals::$user->fetch('', $login, '', 1, ($entity > 0 ? $entity : -1));
481 481
                 if ($resultFetchUser <= 0) {
482 482
 // Account has been removed after login
483
-                    DolUtils::dol_syslog("Can't load user even if session logged. _SESSION['dol_login']=" . $login, LOG_WARNING);
483
+                    DolUtils::dol_syslog("Can't load user even if session logged. _SESSION['dol_login']=".$login, LOG_WARNING);
484 484
                     session_destroy();
485 485
                     session_name($sessionname);
486
-                    session_set_cookie_params(0, '/', null, false, true);   // Add tag httponly on session cookie
487
-                    session_start();    // Fixing the bug of register_globals here is useless since session is empty
486
+                    session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie
487
+                    session_start(); // Fixing the bug of register_globals here is useless since session is empty
488 488
 
489 489
                     if ($resultFetchUser == 0) {
490 490
 // Load translation files required by page
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 
493 493
                         $_SESSION["dol_loginmesg"] = Globals::$langs->trans("ErrorCantLoadUserFromDolibarrDatabase", $login);
494 494
 
495
-                        Globals::$user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login=' . $login;
495
+                        Globals::$user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login='.$login;
496 496
                     }
497 497
                     if ($resultFetchUser < 0) {
498 498
                         $_SESSION["dol_loginmesg"] = Globals::$user->error;
@@ -512,24 +512,24 @@  discard block
 block discarded – undo
512 512
                     $action = '';
513 513
                     Globals::$hookManager->initHooks(array('login'));
514 514
                     $parameters = array('dol_authmode' => $this->dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]);
515
-                    $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action);    // Note that $action and $object may have been modified by some hooks
515
+                    $reshook = Globals::$hookManager->executeHooks('afterLoginFailed', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks
516 516
                     if ($reshook < 0) {
517 517
                         $error++;
518 518
                     }
519 519
 
520 520
                     $paramsurl = array();
521 521
                     if (DolUtils::GETPOST('textbrowser', 'int')) {
522
-                        $paramsurl[] = 'textbrowser=' . DolUtils::GETPOST('textbrowser', 'int');
522
+                        $paramsurl[] = 'textbrowser='.DolUtils::GETPOST('textbrowser', 'int');
523 523
                     }
524 524
                     if (DolUtils::GETPOST('nojs', 'int')) {
525
-                        $paramsurl[] = 'nojs=' . DolUtils::GETPOST('nojs', 'int');
525
+                        $paramsurl[] = 'nojs='.DolUtils::GETPOST('nojs', 'int');
526 526
                     }
527 527
                     if (DolUtils::GETPOST('lang', 'aZ09')) {
528
-                        $paramsurl[] = 'lang=' . DolUtils::GETPOST('lang', 'aZ09');
528
+                        $paramsurl[] = 'lang='.DolUtils::GETPOST('lang', 'aZ09');
529 529
                     }
530
-                    echo 'Location: ' . DOL_BASE_URI . '/index.php' . (count($paramsurl) ? '?' . implode('&', $paramsurl) : '');
530
+                    echo 'Location: '.DOL_BASE_URI.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : '');
531 531
                     throw Exception('x');
532
-                    header('Location: ' . DOL_BASE_URI . '/index.php' . (count($paramsurl) ? '?' . implode('&', $paramsurl) : ''));
532
+                    header('Location: '.DOL_BASE_URI.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : ''));
533 533
                     exit;
534 534
                 } else {
535 535
 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -538,30 +538,30 @@  discard block
 block discarded – undo
538 538
 // Code for search criteria persistence.
539 539
                     if (!empty($_GET['save_lastsearch_values'])) {    // We must use $_GET here
540 540
                         $relativepathstring = preg_replace('/\?.*$/', '', $_SERVER["HTTP_REFERER"]);
541
-                        $relativepathstring = preg_replace('/^https?:\/\/[^\/]*/', '', $relativepathstring);     // Get full path except host server
541
+                        $relativepathstring = preg_replace('/^https?:\/\/[^\/]*/', '', $relativepathstring); // Get full path except host server
542 542
 // Clean $relativepathstring
543 543
                         if (constant('DOL_BASE_URI')) {
544
-                            $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_BASE_URI'), '/') . '/', '', $relativepathstring);
544
+                            $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_BASE_URI'), '/').'/', '', $relativepathstring);
545 545
                         }
546 546
                         $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
547 547
                         $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
548 548
 //var_dump($relativepathstring);
549 549
 // We click on a link that leave a page we have to save search criteria, contextpage, limit and page. We save them from tmp to no tmp
550
-                        if (!empty($_SESSION['lastsearch_values_tmp_' . $relativepathstring])) {
551
-                            $_SESSION['lastsearch_values_' . $relativepathstring] = $_SESSION['lastsearch_values_tmp_' . $relativepathstring];
552
-                            unset($_SESSION['lastsearch_values_tmp_' . $relativepathstring]);
550
+                        if (!empty($_SESSION['lastsearch_values_tmp_'.$relativepathstring])) {
551
+                            $_SESSION['lastsearch_values_'.$relativepathstring] = $_SESSION['lastsearch_values_tmp_'.$relativepathstring];
552
+                            unset($_SESSION['lastsearch_values_tmp_'.$relativepathstring]);
553 553
                         }
554
-                        if (!empty($_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring])) {
555
-                            $_SESSION['lastsearch_contextpage_' . $relativepathstring] = $_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring];
556
-                            unset($_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring]);
554
+                        if (!empty($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring])) {
555
+                            $_SESSION['lastsearch_contextpage_'.$relativepathstring] = $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring];
556
+                            unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]);
557 557
                         }
558
-                        if (!empty($_SESSION['lastsearch_page_tmp_' . $relativepathstring]) && $_SESSION['lastsearch_page_tmp_' . $relativepathstring] > 1) {
559
-                            $_SESSION['lastsearch_page_' . $relativepathstring] = $_SESSION['lastsearch_page_tmp_' . $relativepathstring];
560
-                            unset($_SESSION['lastsearch_page_tmp_' . $relativepathstring]);
558
+                        if (!empty($_SESSION['lastsearch_page_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_page_tmp_'.$relativepathstring] > 1) {
559
+                            $_SESSION['lastsearch_page_'.$relativepathstring] = $_SESSION['lastsearch_page_tmp_'.$relativepathstring];
560
+                            unset($_SESSION['lastsearch_page_tmp_'.$relativepathstring]);
561 561
                         }
562
-                        if (!empty($_SESSION['lastsearch_limit_tmp_' . $relativepathstring]) && $_SESSION['lastsearch_limit_tmp_' . $relativepathstring] != Globals::$conf->liste_limit) {
563
-                            $_SESSION['lastsearch_limit_' . $relativepathstring] = $_SESSION['lastsearch_limit_tmp_' . $relativepathstring];
564
-                            unset($_SESSION['lastsearch_limit_tmp_' . $relativepathstring]);
562
+                        if (!empty($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_limit_tmp_'.$relativepathstring] != Globals::$conf->liste_limit) {
563
+                            $_SESSION['lastsearch_limit_'.$relativepathstring] = $_SESSION['lastsearch_limit_tmp_'.$relativepathstring];
564
+                            unset($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]);
565 565
                         }
566 566
                     }
567 567
 
@@ -609,14 +609,14 @@  discard block
 block discarded – undo
609 609
                     $_SESSION['dol_use_jmobile'] = $dol_use_jmobile;
610 610
                 }
611 611
 
612
-                DolUtils::dol_syslog("This is a new started user session. _SESSION['dol_login']=" . $_SESSION["dol_login"] . " Session id=" . session_id());
612
+                DolUtils::dol_syslog("This is a new started user session. _SESSION['dol_login']=".$_SESSION["dol_login"]." Session id=".session_id());
613 613
 
614 614
                 // Config::$dbEngine->begin();
615 615
                 Config::$dbEngine->beginTransaction();
616 616
 
617 617
                 Globals::$user->update_last_login_date();
618 618
 
619
-                $loginfo = 'TZ=' . $_SESSION["dol_tz"] . ';TZString=' . $_SESSION["dol_tz_string"] . ';Screen=' . $_SESSION["dol_screenwidth"] . 'x' . $_SESSION["dol_screenheight"];
619
+                $loginfo = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"];
620 620
 
621 621
 // Call triggers for the "security events" log
622 622
                 Globals::$user->trigger_mesg = $loginfo;
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
                 $action = '';
633 633
                 Globals::$hookManager->initHooks(array('login'));
634 634
                 $parameters = array('dol_authmode' => $this->dol_authmode, 'dol_loginfo' => $loginfo);
635
-                $reshook = Globals::$hookManager->executeHooks('afterLogin', $parameters, Globals::$user, $action);    // Note that $action and $object may have been modified by some hooks
635
+                $reshook = Globals::$hookManager->executeHooks('afterLogin', $parameters, Globals::$user, $action); // Note that $action and $object may have been modified by some hooks
636 636
                 if ($reshook < 0) {
637 637
                     $error++;
638 638
                 }
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
                     if ($_SERVER["PHP_SELF"] != $newpath) {   // not already on landing page (avoid infinite loop)
654 654
                         echo $newpath;
655 655
                         throw Exception('x');
656
-                        header('Location: ' . $newpath);
656
+                        header('Location: '.$newpath);
657 657
                         exit;
658 658
                     }
659 659
                 }
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
             if (empty(Globals::$conf->global->MAIN_FORCETHEME) && !empty(Globals::$user->conf->MAIN_THEME)) {
686 686
                 Globals::$conf->theme = Globals::$user->conf->MAIN_THEME;
687 687
 // Globals::$conf->css = "/theme/" . Globals::$conf->theme . "/style.css.php";
688
-                Globals::$conf->css = '?controller=theme/' . Globals::$conf->theme . '&method=style.css';
688
+                Globals::$conf->css = '?controller=theme/'.Globals::$conf->theme.'&method=style.css';
689 689
             }
690 690
         }
691 691
 
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
         if (DolUtils::GETPOST('theme', 'alpha')) {
694 694
             Globals::$conf->theme = DolUtils::GETPOST('theme', 'alpha', 1);
695 695
 // Globals::$conf->css = "/theme/" . Globals::$conf->theme . "/style.css.php";
696
-            Globals::$conf->css = '?controller=theme/' . Globals::$conf->theme . '&method=style.css';
696
+            Globals::$conf->css = '?controller=theme/'.Globals::$conf->theme.'&method=style.css';
697 697
         }
698 698
 
699 699
 
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
         if (!empty(Globals::$conf->dol_use_jmobile) && in_array(Globals::$conf->theme, array('bureau2crea', 'cameleo', 'amarok'))) {
744 744
             Globals::$conf->theme = 'eldy';
745 745
 // Globals::$conf->css = "/theme/" . Globals::$conf->theme . "/style.css.php";
746
-            Globals::$conf->css = '?controller=theme/' . Globals::$conf->theme . '&method=style.css';
746
+            Globals::$conf->css = '?controller=theme/'.Globals::$conf->theme.'&method=style.css';
747 747
         }
748 748
 
749 749
         if (!defined('NOREQUIRETRAN')) {
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
         }
781 781
 
782 782
 
783
-        DolUtils::dol_syslog("--- Access to " . $_SERVER["PHP_SELF"] . ' - action=' . DolUtils::GETPOST('action', 'az09') . ', massaction=' . DolUtils::GETPOST('massaction', 'az09'));
783
+        DolUtils::dol_syslog("--- Access to ".$_SERVER["PHP_SELF"].' - action='.DolUtils::GETPOST('action', 'az09').', massaction='.DolUtils::GETPOST('massaction', 'az09'));
784 784
 //Another call for easy debugg
785 785
 //dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST));
786 786
 // Load main languages files
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 // Define some constants used for style of arrays
793 793
         $bc = array(0 => 'class="impair"', 1 => 'class="pair"');
794 794
         $bcdd = array(0 => 'class="drag drop oddeven"', 1 => 'class="drag drop oddeven"');
795
-        $bcnd = array(0 => 'class="nodrag nodrop nohover"', 1 => 'class="nodrag nodrop nohoverpair"');  // Used for tr to add new lines
795
+        $bcnd = array(0 => 'class="nodrag nodrop nohover"', 1 => 'class="nodrag nodrop nohoverpair"'); // Used for tr to add new lines
796 796
         $bctag = array(0 => 'class="impair tagtr"', 1 => 'class="pair tagtr"');
797 797
 
798 798
 // Define messages variables
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
 // Load the menu manager (only if not already done)
841 841
             $file_menu = Globals::$conf->standard_menu;
842 842
             if (DolUtils::GETPOST('menu', 'alpha')) {
843
-                $file_menu = DolUtils::GETPOST('menu', 'alpha');     // example: menu=eldy_menu.php
843
+                $file_menu = DolUtils::GETPOST('menu', 'alpha'); // example: menu=eldy_menu.php
844 844
             }
845 845
             if (!class_exists('MenuManager')) {
846 846
                 $menufound = 0;
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
                     }
853 853
                 }
854 854
                 if (!class_exists('MenuManager')) { // If failed to include, we try with standard eldy_menu.php
855
-                    DolUtils::dol_syslog("You define a menu manager '" . $file_menu . "' that can not be loaded.", LOG_WARNING);
855
+                    DolUtils::dol_syslog("You define a menu manager '".$file_menu."' that can not be loaded.", LOG_WARNING);
856 856
                     $file_menu = 'eldy_menu.php';
857 857
                     // include_once DOL_DOCUMENT_ROOT . "/core/menus/standard/" . $file_menu;
858 858
                 }
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
 
897 897
         // This is to make Dolibarr working with Plesk
898 898
         if (!empty($_SERVER['DOCUMENT_ROOT']) && substr($_SERVER['DOCUMENT_ROOT'], -6) !== 'htdocs') {
899
-            set_include_path($_SERVER['DOCUMENT_ROOT'] . '/htdocs');
899
+            set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
900 900
         }
901 901
 
902 902
         // If there is a POST parameter to tell to save automatically some POST parameters into cookies, we do it.
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
             $tmplist = explode(',', $tmpautoset[1]);
908 908
             $cookiearrayvalue = array();
909 909
             foreach ($tmplist as $tmpkey) {
910
-                $postkey = $tmpautoset[0] . '_' . $tmpkey;
910
+                $postkey = $tmpautoset[0].'_'.$tmpkey;
911 911
 //var_dump('tmpkey='.$tmpkey.' postkey='.$postkey.' value='.$_POST[$postkey]);
912 912
                 if (!empty($_POST[$postkey])) {
913 913
                     $cookiearrayvalue[$tmpkey] = $_POST[$postkey];
@@ -968,8 +968,8 @@  discard block
 block discarded – undo
968 968
             $inj += preg_match('/insert\s+into/i', $val);
969 969
             $inj += preg_match('/select\s+from/i', $val);
970 970
             $inj += preg_match('/into\s+(outfile|dumpfile)/i', $val);
971
-            $inj += preg_match('/user\s*\(/i', $val);      // avoid to use function user() that return current database login
972
-            $inj += preg_match('/information_schema/i', $val);    // avoid to use request that read information_schema database
971
+            $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() that return current database login
972
+            $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database
973 973
         }
974 974
         if ($type == 3) {
975 975
             $inj += preg_match('/select|update|delete|replace|group\s+by|concat|count|from/i', $val);
@@ -993,15 +993,15 @@  discard block
 block discarded – undo
993 993
             $inj += preg_match('/<style/i', $val);
994 994
         }
995 995
         $inj += preg_match('/base[\s]+href/si', $val);
996
-        $inj += preg_match('/<.*onmouse/si', $val);       // onmousexxx can be set on img or any html tag like <img title='...' onmouseover=alert(1)>
997
-        $inj += preg_match('/onerror\s*=/i', $val);       // onerror can be set on img or any html tag like <img title='...' onerror = alert(1)>
998
-        $inj += preg_match('/onfocus\s*=/i', $val);       // onfocus can be set on input text html tag like <input type='text' value='...' onfocus = alert(1)>
999
-        $inj += preg_match('/onload\s*=/i', $val);        // onload can be set on svg tag <svg/onload=alert(1)> or other tag like body <body onload=alert(1)>
1000
-        $inj += preg_match('/onloadstart\s*=/i', $val);   // onload can be set on audio tag <audio onloadstart=alert(1)>
1001
-        $inj += preg_match('/onclick\s*=/i', $val);       // onclick can be set on img text html tag like <img onclick = alert(1)>
1002
-        $inj += preg_match('/onscroll\s*=/i', $val);      // onscroll can be on textarea
996
+        $inj += preg_match('/<.*onmouse/si', $val); // onmousexxx can be set on img or any html tag like <img title='...' onmouseover=alert(1)>
997
+        $inj += preg_match('/onerror\s*=/i', $val); // onerror can be set on img or any html tag like <img title='...' onerror = alert(1)>
998
+        $inj += preg_match('/onfocus\s*=/i', $val); // onfocus can be set on input text html tag like <input type='text' value='...' onfocus = alert(1)>
999
+        $inj += preg_match('/onload\s*=/i', $val); // onload can be set on svg tag <svg/onload=alert(1)> or other tag like body <body onload=alert(1)>
1000
+        $inj += preg_match('/onloadstart\s*=/i', $val); // onload can be set on audio tag <audio onloadstart=alert(1)>
1001
+        $inj += preg_match('/onclick\s*=/i', $val); // onclick can be set on img text html tag like <img onclick = alert(1)>
1002
+        $inj += preg_match('/onscroll\s*=/i', $val); // onscroll can be on textarea
1003 1003
 //$inj += preg_match('/on[A-Z][a-z]+\*=/', $val);   // To lock event handlers onAbort(), ...
1004
-        $inj += preg_match('/&#58;|&#0000058|&#x3A/i', $val);  // refused string ':' encoded (no reason to have it encoded) to lock 'javascript:...'
1004
+        $inj += preg_match('/&#58;|&#0000058|&#x3A/i', $val); // refused string ':' encoded (no reason to have it encoded) to lock 'javascript:...'
1005 1005
 //if ($type == 1)
1006 1006
 //{
1007 1007
         $inj += preg_match('/javascript:/i', $val);
@@ -1009,10 +1009,10 @@  discard block
 block discarded – undo
1009 1009
 //}
1010 1010
 // For XSS Injection done by adding javascript closing html tags like with onmousemove, etc... (closing a src or href tag with not cleaned param)
1011 1011
         if ($type == 1) {
1012
-            $inj += preg_match('/"/i', $val);  // We refused " in GET parameters value
1012
+            $inj += preg_match('/"/i', $val); // We refused " in GET parameters value
1013 1013
         }
1014 1014
         if ($type == 2) {
1015
-            $inj += preg_match('/[;"]/', $val);  // PHP_SELF is a file system path. It can contains spaces.
1015
+            $inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces.
1016 1016
         }
1017 1017
         return $inj;
1018 1018
     }
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
                 if ($this->analyseVarsForSqlAndScriptsInjection($key, $type) && $this->analyseVarsForSqlAndScriptsInjection($value, $type)) {
1032 1032
 //$var[$key] = $value;	// This is useless
1033 1033
                 } else {
1034
-                    print 'Access refused by SQL/Script injection protection in main.inc.php (type=' . htmlentities($type) . ' key=' . htmlentities($key) . ' value=' . htmlentities($value) . ' page=' . htmlentities($_SERVER["REQUEST_URI"]) . ')';
1034
+                    print 'Access refused by SQL/Script injection protection in main.inc.php (type='.htmlentities($type).' key='.htmlentities($key).' value='.htmlentities($value).' page='.htmlentities($_SERVER["REQUEST_URI"]).')';
1035 1035
                     exit;
1036 1036
                 }
1037 1037
             }
Please login to merge, or discard this patch.
Base/CommonObject.php 3 patches
Indentation   +7071 added lines, -7071 removed lines patch added patch discarded remove patch
@@ -21,7389 +21,7389 @@
 block discarded – undo
21 21
 
22 22
 abstract class CommonObject
23 23
 {
24
-	/**
24
+    /**
25 25
      * @var int The object identifier
26 26
      */
27
-	public $id;
28
-
29
-	/**
30
-	 * @var string 		Error string
31
-	 * @see             errors
32
-	 */
33
-	public $error;
34
-
35
-	/**
36
-	 * @var string[]	Array of error strings
37
-	 */
38
-	public $errors=array();
39
-
40
-	/**
41
-	 * @var string ID to identify managed object
42
-	 */
43
-	public $element;
44
-
45
-	/**
46
-	 * @var string Name of table without prefix where object is stored
47
-	 */
48
-	public $table_element;
49
-
50
-	/**
51
-	 * @var int    Name of subtable line
52
-	 */
53
-	public $table_element_line='';
54
-
55
-	/**
56
-	 * @var string		Key value used to track if data is coming from import wizard
57
-	 */
58
-	public $import_key;
59
-
60
-	/**
61
-	 * @var mixed		Contains data to manage extrafields
62
-	 */
63
-	public $array_options=array();
64
-
65
-	/**
66
-	 * @var int[][]		Array of linked objects ids. Loaded by ->fetchObjectLinked
67
-	 */
68
-	public $linkedObjectsIds;
69
-
70
-	/**
71
-	 * @var mixed		Array of linked objects. Loaded by ->fetchObjectLinked
72
-	 */
73
-	public $linkedObjects;
74
-
75
-	/**
76
-	 * @var Object      To store a cloned copy of object before to edit it and keep track of old properties
77
-	 */
78
-	public $oldcopy;
79
-
80
-	/**
81
-	 * @var string		Column name of the ref field.
82
-	 */
83
-	protected $table_ref_field = '';
84
-
85
-
86
-
87
-	// Following vars are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them.
88
-
89
-	/**
90
-	 * @var array<string,mixed>		Can be used to pass information when only object is provided to method
91
-	 */
92
-	public $context=array();
93
-
94
-	/**
95
-	 * @var string		Contains canvas name if record is an alternative canvas record
96
-	 */
97
-	public $canvas;
98
-
99
-	/**
100
-	 * @var Project The related project
101
-	 * @see fetch_projet()
102
-	 */
103
-	public $project;
104
-
105
-	/**
106
-	 * @var int The related project ID
107
-	 * @see setProject(), project
108
-	 */
109
-	public $fk_project;
110
-
111
-	/**
112
-	 * @deprecated
113
-	 * @see project
114
-	 */
115
-	public $projet;
116
-
117
-	/**
118
-	 * @var Contact a related contact
119
-	 * @see fetch_contact()
120
-	 */
121
-	public $contact;
122
-
123
-	/**
124
-	 * @var int The related contact ID
125
-	 * @see fetch_contact()
126
-	 */
127
-	public $contact_id;
128
-
129
-	/**
130
-	 * @var Societe A related thirdparty
131
-	 * @see fetch_thirdparty()
132
-	 */
133
-	public $thirdparty;
134
-
135
-	/**
136
-	 * @var User A related user
137
-	 * @see fetch_user()
138
-	 */
139
-	public $user;
140
-
141
-	/**
142
-	 * @var string 	The type of originating object ('commande', 'facture', ...)
143
-	 * @see fetch_origin()
144
-	 */
145
-	public $origin;
146
-
147
-	/**
148
-	 * @var int 	The id of originating object
149
-	 * @see fetch_origin()
150
-	 */
151
-	public $origin_id;
152
-
153
-	/**
154
-	 * @var string The object's reference
155
-	 */
156
-	public $ref;
157
-
158
-	/**
159
-	 * @var string The object's previous reference
160
-	 */
161
-	public $ref_previous;
162
-
163
-	/**
164
-	 * @var string The object's next reference
165
-	 */
166
-	public $ref_next;
167
-
168
-	/**
169
-	 * @var string An external reference for the object
170
-	 */
171
-	public $ref_ext;
172
-
173
-	/**
174
-	 * @var int The object's status
175
-	 * @see setStatut()
176
-	 */
177
-	public $statut;
178
-
179
-	/**
180
-	 * @var string
181
-	 * @see getFullAddress()
182
-	 */
183
-	public $country;
184
-
185
-	/**
186
-	 * @var int
187
-	 * @see getFullAddress(), country
188
-	 */
189
-	public $country_id;
190
-
191
-	/**
192
-	 * @var string
193
-	 * @see getFullAddress(), isInEEC(), country
194
-	 */
195
-    public $country_code;
27
+    public $id;
196 28
 
197 29
     /**
198
-	 * @var string
199
-	 * @see getFullAddress()
200
-	 */
201
-	public $state;
202
-
203
-	/**
204
-	 * @var int
205
-	 * @see getFullAddress(), state
206
-	 */
207
-	public $state_id;
30
+     * @var string 		Error string
31
+     * @see             errors
32
+     */
33
+    public $error;
208 34
 
209
-	/**
210
-	 * @var string
211
-	 * @see getFullAddress(), state
212
-	 */
213
-    public $state_code;
35
+    /**
36
+     * @var string[]	Array of error strings
37
+     */
38
+    public $errors=array();
214 39
 
215 40
     /**
216
-	 * @var string
217
-	 * @see getFullAddress(), region
218
-	 */
219
-	public $region;
41
+     * @var string ID to identify managed object
42
+     */
43
+    public $element;
220 44
 
221
-	/**
222
-	 * @var string
223
-	 * @see getFullAddress(), region
224
-	 */
225
-    public $region_code;
45
+    /**
46
+     * @var string Name of table without prefix where object is stored
47
+     */
48
+    public $table_element;
226 49
 
227
-	/**
228
-	 * @var int
229
-	 * @see fetch_barcode()
230
-	 */
231
-	public $barcode_type;
232
-
233
-	/**
234
-	 * @var string
235
-	 * @see fetch_barcode(), barcode_type
236
-	 */
237
-	public $barcode_type_code;
238
-
239
-	/**
240
-	 * @var string
241
-	 * @see fetch_barcode(), barcode_type
242
-	 */
243
-	public $barcode_type_label;
244
-
245
-	/**
246
-	 * @var string
247