@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | session_set_cookie_params($sessioncookieparams); |
136 | 136 | } |
137 | 137 | session_name($sessionname); |
138 | - dol_session_start(); // This call the open and read of session handler |
|
138 | + dol_session_start(); // This call the open and read of session handler |
|
139 | 139 | //exit; // this exist generates a call to write and close |
140 | 140 | } |
141 | 141 | |
@@ -163,11 +163,11 @@ discard block |
||
163 | 163 | if (!$ok) { |
164 | 164 | if (session_id() && isset($_SESSION["dol_login"]) && !in_array($_SESSION["dol_login"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) { |
165 | 165 | print 'Sorry, your application is offline.'."\n"; |
166 | - print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
166 | + print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
167 | 167 | $nexturl = DOL_URL_ROOT.'/user/logout.php?token='.newToken(); |
168 | 168 | print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n"; |
169 | 169 | } else { |
170 | - print 'Sorry, your application is offline. Only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
170 | + print 'Sorry, your application is offline. Only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
171 | 171 | $nexturl = DOL_URL_ROOT.'/'; |
172 | 172 | print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n"; |
173 | 173 | } |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | print "Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n"; |
384 | 384 | print "If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0"; |
385 | 385 | if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) { |
386 | - print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
386 | + print " instead of ".getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
387 | 387 | } |
388 | 388 | print " into setup).\n"; |
389 | 389 | } |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | unset($_GET['action']); |
412 | 412 | unset($_GET['confirmmassaction']); |
413 | 413 | unset($_GET['massaction']); |
414 | - unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
414 | + unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
415 | 415 | if (isset($savid)) { |
416 | 416 | $_POST['id'] = ((int) $savid); |
417 | 417 | } |
@@ -433,18 +433,18 @@ discard block |
||
433 | 433 | foreach ($disabled_modules as $module) { |
434 | 434 | if ($module) { |
435 | 435 | if (empty($conf->$module)) { |
436 | - $conf->$module = new stdClass(); // To avoid warnings |
|
436 | + $conf->$module = new stdClass(); // To avoid warnings |
|
437 | 437 | } |
438 | 438 | |
439 | - $conf->$module->enabled = false; // Old usage |
|
439 | + $conf->$module->enabled = false; // Old usage |
|
440 | 440 | unset($conf->modules[$module]); |
441 | 441 | |
442 | 442 | foreach ($modulepartkeys as $modulepartkey) { |
443 | 443 | unset($conf->modules_parts[$modulepartkey][$module]); |
444 | 444 | } |
445 | 445 | if ($module == 'fournisseur') { // Special case |
446 | - $conf->supplier_order->enabled = 0; // Old usage |
|
447 | - $conf->supplier_invoice->enabled = 0; // Old usage |
|
446 | + $conf->supplier_order->enabled = 0; // Old usage |
|
447 | + $conf->supplier_invoice->enabled = 0; // Old usage |
|
448 | 448 | unset($conf->modules['supplier_order']); |
449 | 449 | unset($conf->modules['supplier_invoice']); |
450 | 450 | } |
@@ -580,12 +580,12 @@ discard block |
||
580 | 580 | if (is_object($captchaobj) && method_exists($captchaobj, 'validateCodeAfterLoginSubmit')) { |
581 | 581 | $ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod |
582 | 582 | } else { |
583 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
583 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
584 | 584 | $test = false; |
585 | 585 | $error++; |
586 | 586 | } |
587 | 587 | } else { |
588 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
588 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
589 | 589 | $test = false; |
590 | 590 | $error++; |
591 | 591 | } |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | |
630 | 630 | $allowedmethodtopostusername = 3; |
631 | 631 | if (defined('MAIN_AUTHENTICATION_POST_METHOD')) { |
632 | - $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
632 | + $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
633 | 633 | } |
634 | 634 | // TODO Remove use of $_COOKIE['login_dolibarr'] by replacing line with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); ? |
635 | 635 | $usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername)); |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | } |
772 | 772 | |
773 | 773 | // Show login form |
774 | - dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
774 | + dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
775 | 775 | } |
776 | 776 | exit; |
777 | 777 | } |
@@ -1129,7 +1129,7 @@ discard block |
||
1129 | 1129 | } else { |
1130 | 1130 | // We may have NOLOGIN set, but NOREQUIREUSER not |
1131 | 1131 | if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) { |
1132 | - $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
1132 | + $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
1133 | 1133 | } |
1134 | 1134 | } |
1135 | 1135 | |
@@ -1192,7 +1192,7 @@ discard block |
||
1192 | 1192 | $conf->dol_optimize_smallscreen = 1; |
1193 | 1193 | |
1194 | 1194 | if (getDolGlobalInt('PRODUIT_DESC_IN_FORM') == 1) { |
1195 | - $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case |
|
1195 | + $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case |
|
1196 | 1196 | } |
1197 | 1197 | } |
1198 | 1198 | // Replace themes bugged with jmobile with eldy |
@@ -1321,7 +1321,7 @@ discard block |
||
1321 | 1321 | |
1322 | 1322 | if (!empty(GETPOST('seteventmessages', 'alpha'))) { |
1323 | 1323 | $message = GETPOST('seteventmessages', 'alpha'); |
1324 | - $messages = explode(',', $message); |
|
1324 | + $messages = explode(',', $message); |
|
1325 | 1325 | foreach ($messages as $key => $msg) { |
1326 | 1326 | $tmp = explode(':', $msg); |
1327 | 1327 | setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs'); |
@@ -1632,7 +1632,7 @@ discard block |
||
1632 | 1632 | } |
1633 | 1633 | |
1634 | 1634 | if (getDolGlobalString('THEME_ELDY_TOPMENU_BACK1')) { |
1635 | - print '<meta name="theme-color" content="rgb(' . getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
1635 | + print '<meta name="theme-color" content="rgb('.getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
1636 | 1636 | } |
1637 | 1637 | |
1638 | 1638 | // Auto refresh page |
@@ -1720,9 +1720,9 @@ discard block |
||
1720 | 1720 | $jquerytheme = getDolGlobalString('MAIN_USE_JQUERY_THEME'); |
1721 | 1721 | } |
1722 | 1722 | if (constant('JS_JQUERY_UI')) { |
1723 | - print '<link rel="stylesheet" type="text/css" href="' . JS_JQUERY_UI . 'css/' . $jquerytheme . '/jquery-ui.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // Forced JQuery |
|
1723 | + print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css'.($ext ? '?'.$ext : '').'">'."\n"; // Forced JQuery |
|
1724 | 1724 | } else { |
1725 | - print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // JQuery |
|
1725 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.css'.($ext ? '?'.$ext : '').'">'."\n"; // JQuery |
|
1726 | 1726 | } |
1727 | 1727 | } |
1728 | 1728 | if (!defined('DISABLE_JQUERY_JNOTIFY')) { |
@@ -1755,7 +1755,7 @@ discard block |
||
1755 | 1755 | |
1756 | 1756 | if (!defined('DISABLE_CSS_DEFAULT_THEME')) { |
1757 | 1757 | print '<!-- Includes CSS for Dolibarr theme -->'."\n"; |
1758 | - print '<link rel="stylesheet" type="text/css" href="' . $themepath . $themeparam . '">' . "\n"; |
|
1758 | + print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n"; |
|
1759 | 1759 | } |
1760 | 1760 | |
1761 | 1761 | if (getDolGlobalString('MAIN_FIX_FLASH_ON_CHROME')) { |
@@ -1826,9 +1826,9 @@ discard block |
||
1826 | 1826 | } |
1827 | 1827 | if (!defined('DISABLE_JQUERY_UI')) { |
1828 | 1828 | if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { |
1829 | - print '<script nonce="' . getNonce() . '" src="' . JS_JQUERY_UI . 'jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
1829 | + print '<script nonce="'.getNonce().'" src="'.JS_JQUERY_UI.'jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
1830 | 1830 | } else { |
1831 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
1831 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
1832 | 1832 | } |
1833 | 1833 | } |
1834 | 1834 | // jQuery jnotify |
@@ -1923,7 +1923,7 @@ discard block |
||
1923 | 1923 | // Global js function |
1924 | 1924 | print '<!-- Includes JS of Dolibarr -->'."\n"; |
1925 | 1925 | if (!defined('DISABLE_LIB_HEAD_JS')) { |
1926 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/core/js/lib_head.js.php?lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n"; |
|
1926 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n"; |
|
1927 | 1927 | } |
1928 | 1928 | |
1929 | 1929 | // Leaflet |
@@ -1974,7 +1974,7 @@ discard block |
||
1974 | 1974 | print $head."\n"; |
1975 | 1975 | } |
1976 | 1976 | if (getDolGlobalString('MAIN_HTML_HEADER')) { |
1977 | - print getDolGlobalString('MAIN_HTML_HEADER') . "\n"; |
|
1977 | + print getDolGlobalString('MAIN_HTML_HEADER')."\n"; |
|
1978 | 1978 | } |
1979 | 1979 | |
1980 | 1980 | $parameters = array(); |
@@ -2117,7 +2117,7 @@ discard block |
||
2117 | 2117 | |
2118 | 2118 | $toprightmenu .= '</div>'; |
2119 | 2119 | |
2120 | - $toprightmenu .= '</div>'."\n"; // end div class="login_block_tools" |
|
2120 | + $toprightmenu .= '</div>'."\n"; // end div class="login_block_tools" |
|
2121 | 2121 | |
2122 | 2122 | |
2123 | 2123 | // Add block for other tools |
@@ -2868,7 +2868,7 @@ discard block |
||
2868 | 2868 | $langs->load(explode('@', $item['name'])[1]); |
2869 | 2869 | $dropDownQuickAddHtml .= ' |
2870 | 2870 | <a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item['url'].'" title="'.$langs->trans(explode('@', $item['title'])[0]).'"> |
2871 | - '. img_picto('', $item['picto'], 'style="width:18px;"') . ' ' . $langs->trans(explode('@', $item['name'])[0]) . '</a> |
|
2871 | + '. img_picto('', $item['picto'], 'style="width:18px;"').' '.$langs->trans(explode('@', $item['name'])[0]).'</a> |
|
2872 | 2872 | '; |
2873 | 2873 | } |
2874 | 2874 | |
@@ -2987,7 +2987,7 @@ discard block |
||
2987 | 2987 | */ |
2988 | 2988 | function top_menu_search() |
2989 | 2989 | { |
2990 | - global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php |
|
2990 | + global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php |
|
2991 | 2991 | |
2992 | 2992 | $html = ''; |
2993 | 2993 | |
@@ -3753,7 +3753,7 @@ discard block |
||
3753 | 3753 | $forceping = GETPOST('forceping', 'alpha'); |
3754 | 3754 | if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) { |
3755 | 3755 | //print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'; |
3756 | - $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
3756 | + $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
3757 | 3757 | |
3758 | 3758 | if (!getDolGlobalString('MAIN_FIRST_PING_OK_DATE') |
3759 | 3759 | || (!empty($conf->file->instance_unique_id) && ($hash_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID) && (getDolGlobalString('MAIN_FIRST_PING_OK_ID') != 'disabled')) |
@@ -381,19 +381,19 @@ |
||
381 | 381 | print '<tr class="oddeven">'; |
382 | 382 | print '<td>'.$langs->transnoentitiesnoconv("multicurrency_appId").'</td>'; |
383 | 383 | print '<td class="right">'; |
384 | - print '<input class="width300" type="text" name="MULTICURRENCY_APP_KEY" value="' . getDolGlobalString('MULTICURRENCY_APP_KEY').'" /> '; |
|
384 | + print '<input class="width300" type="text" name="MULTICURRENCY_APP_KEY" value="'.getDolGlobalString('MULTICURRENCY_APP_KEY').'" /> '; |
|
385 | 385 | print '</td></tr>'; |
386 | 386 | |
387 | 387 | print '<tr class="oddeven">'; |
388 | 388 | print '<td>'.$langs->transnoentitiesnoconv("multicurrency_appCurrencySource").'</td>'; |
389 | 389 | print '<td class="right">'; |
390 | - print '<input type="text" name="MULTICURRENCY_APP_SOURCE" value="' . getDolGlobalString('MULTICURRENCY_APP_SOURCE').'" size="10" placeholder="USD" /> '; // Default: USD |
|
390 | + print '<input type="text" name="MULTICURRENCY_APP_SOURCE" value="'.getDolGlobalString('MULTICURRENCY_APP_SOURCE').'" size="10" placeholder="USD" /> '; // Default: USD |
|
391 | 391 | print '</td></tr>'; |
392 | 392 | |
393 | 393 | print '<tr class="oddeven">'; |
394 | 394 | print '<td>'.$langs->transnoentitiesnoconv("MULTICURRENCY_APP_ENDPOINT").'</td>'; |
395 | 395 | print '<td class="right">'; |
396 | - print '<input class="width500" type="text" name="MULTICURRENCY_APP_ENDPOINT" value="' . getDolGlobalString('MULTICURRENCY_APP_ENDPOINT', MultiCurrency::MULTICURRENCY_APP_ENDPOINT_DEFAULT).'" /> '; |
|
396 | + print '<input class="width500" type="text" name="MULTICURRENCY_APP_ENDPOINT" value="'.getDolGlobalString('MULTICURRENCY_APP_ENDPOINT', MultiCurrency::MULTICURRENCY_APP_ENDPOINT_DEFAULT).'" /> '; |
|
397 | 397 | print '</td></tr>'; |
398 | 398 | |
399 | 399 | /*print '<tr class="oddeven">'; |
@@ -716,7 +716,7 @@ |
||
716 | 716 | return 1; |
717 | 717 | } else { |
718 | 718 | if (isset($response->error->info)) { |
719 | - $error_info_syslog = $response->error->info; // @phan-suppress-current-line PhanTypeExpectedObjectPropAccess |
|
719 | + $error_info_syslog = $response->error->info; // @phan-suppress-current-line PhanTypeExpectedObjectPropAccess |
|
720 | 720 | $error_info = $error_info_syslog; |
721 | 721 | } else { |
722 | 722 | $error_info_syslog = json_encode($response); |
@@ -30,11 +30,11 @@ |
||
30 | 30 | |
31 | 31 | |
32 | 32 | /** |
33 | - * Return array of Emojis. We can't move this function inside a common lib because we need it for security before loading any file. |
|
34 | - * |
|
35 | - * @return array<string,array<string>> Array of Emojis in hexadecimal |
|
36 | - * @see getArrayOfEmojiBis() |
|
37 | - */ |
|
33 | + * Return array of Emojis. We can't move this function inside a common lib because we need it for security before loading any file. |
|
34 | + * |
|
35 | + * @return array<string,array<string>> Array of Emojis in hexadecimal |
|
36 | + * @see getArrayOfEmojiBis() |
|
37 | + */ |
|
38 | 38 | function getArrayOfEmoji() |
39 | 39 | { |
40 | 40 | $arrayofcommonemoji = array( |
@@ -38,15 +38,15 @@ discard block |
||
38 | 38 | function getArrayOfEmoji() |
39 | 39 | { |
40 | 40 | $arrayofcommonemoji = array( |
41 | - 'misc' => array('2600', '26FF'), // Miscellaneous Symbols |
|
42 | - 'ding' => array('2700', '27BF'), // Dingbats |
|
43 | - '????' => array('9989', '9989'), // Variation Selectors |
|
44 | - 'vars' => array('FE00', 'FE0F'), // Variation Selectors |
|
45 | - 'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs |
|
46 | - 'emot' => array('1F600', '1F64F'), // Emoticons |
|
47 | - 'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols |
|
48 | - 'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0) |
|
49 | - 'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs |
|
41 | + 'misc' => array('2600', '26FF'), // Miscellaneous Symbols |
|
42 | + 'ding' => array('2700', '27BF'), // Dingbats |
|
43 | + '????' => array('9989', '9989'), // Variation Selectors |
|
44 | + 'vars' => array('FE00', 'FE0F'), // Variation Selectors |
|
45 | + 'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs |
|
46 | + 'emot' => array('1F600', '1F64F'), // Emoticons |
|
47 | + 'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols |
|
48 | + 'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0) |
|
49 | + 'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs |
|
50 | 50 | ); |
51 | 51 | |
52 | 52 | return $arrayofcommonemoji; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | //print "before decoding $val\n"; |
109 | 109 | do { |
110 | 110 | $oldval = $val; |
111 | - $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5); // Decode ':', ''', '	', '&NewLine', ... |
|
111 | + $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5); // Decode ':', ''', '	', '&NewLine', ... |
|
112 | 112 | // Sometimes we have entities without the ; at end so html_entity_decode does not work but entities is still interpreted by browser. |
113 | 113 | $val = preg_replace_callback( |
114 | 114 | '/&#(x?[0-9][0-9a-f]+;?)/i', |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @param string[] $m |
117 | 117 | * @return string |
118 | 118 | */ |
119 | - static function ($m) { |
|
119 | + static function($m) { |
|
120 | 120 | // Decode 'n', ... |
121 | 121 | return realCharForNumericEntities($m); |
122 | 122 | }, |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() or mysql_user() that return current database login |
158 | 158 | $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database |
159 | 159 | $inj += preg_match('/<svg/i', $val); // <svg can be allowed in POST |
160 | - $inj += preg_match('/update[^&=\w].*set.+=/i', $val); // the [^&=\w] test is to avoid error when request is like action=update&...set... or &updatemodule=...set... |
|
160 | + $inj += preg_match('/update[^&=\w].*set.+=/i', $val); // the [^&=\w] test is to avoid error when request is like action=update&...set... or &updatemodule=...set... |
|
161 | 161 | $inj += preg_match('/union.+select/i', $val); |
162 | 162 | } |
163 | 163 | if ($type == 3) { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | /** |
71 | 71 | * @var ?int Page ID |
72 | 72 | */ |
73 | - public $fk_page; // If translation of another page |
|
73 | + public $fk_page; // If translation of another page |
|
74 | 74 | |
75 | 75 | /** |
76 | 76 | * @var string Page url |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | public $newid; |
174 | 174 | |
175 | 175 | |
176 | - const STATUS_DRAFT = 0; // offline |
|
177 | - const STATUS_VALIDATED = 1; // online |
|
176 | + const STATUS_DRAFT = 0; // offline |
|
177 | + const STATUS_VALIDATED = 1; // online |
|
178 | 178 | |
179 | 179 | |
180 | 180 | /** |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | $sql .= " t.htmlheader,"; |
303 | 303 | $sql .= " t.content,"; |
304 | 304 | $sql .= " t.lang,"; |
305 | - $sql .= " t.fk_page,"; // Translation parent page (in mani language) |
|
305 | + $sql .= " t.fk_page,"; // Translation parent page (in mani language) |
|
306 | 306 | $sql .= " t.allowed_in_frames,"; |
307 | 307 | $sql .= " t.status,"; |
308 | 308 | $sql .= " t.grabbed_from,"; |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | $ai = new Ai($db); |
76 | 76 | |
77 | 77 | // Get parameters |
78 | -$function = empty($jsonData['function']) ? 'textgeneration' : $jsonData['function']; // Default value. Can also be 'textgeneration', 'textgenerationemail', 'textgenerationwebpage', 'imagegeneration', 'videogeneration', ... |
|
78 | +$function = empty($jsonData['function']) ? 'textgeneration' : $jsonData['function']; // Default value. Can also be 'textgeneration', 'textgenerationemail', 'textgenerationwebpage', 'imagegeneration', 'videogeneration', ... |
|
79 | 79 | $instructions = dol_string_nohtmltag($jsonData['instructions'], 1, 'UTF-8'); |
80 | -$format = empty($jsonData['format']) ? '' : $jsonData['format']; // Can be '' for text, 'html', ... |
|
80 | +$format = empty($jsonData['format']) ? '' : $jsonData['format']; // Can be '' for text, 'html', ... |
|
81 | 81 | |
82 | 82 | if ($function == 'texttranslation') { |
83 | 83 | $instructions = $jsonData['instructions']; |
@@ -92,16 +92,16 @@ discard block |
||
92 | 92 | if (!empty($generatedContent['code']) && $generatedContent['code'] == 429) { |
93 | 93 | print "Quota or allowed period exceeded. Retry Later !"; |
94 | 94 | } elseif (!empty($generatedContent['code']) && $generatedContent['code'] >= 400) { |
95 | - print "Error : " . $generatedContent['message']; |
|
95 | + print "Error : ".$generatedContent['message']; |
|
96 | 96 | print '<br><a href="'.DOL_MAIN_URL_ROOT.'/ai/admin/setup.php">'.$langs->trans('ErrorGoToModuleSetup').'</a>'; |
97 | 97 | } elseif (!empty($generatedContent['message'])) { |
98 | - print "Error returned by API call: " . $generatedContent['message']; |
|
98 | + print "Error returned by API call: ".$generatedContent['message']; |
|
99 | 99 | } else { |
100 | 100 | print "Error API returned no answer"; |
101 | 101 | } |
102 | 102 | } else { |
103 | 103 | if ($function == 'textgenerationemail' || $function == 'textgenerationwebpage' || $function == "texttranslation") { |
104 | - print dolPrintHTML($generatedContent); // Note that common HTML tags are NOT escaped (but a sanitization is done) |
|
104 | + print dolPrintHTML($generatedContent); // Note that common HTML tags are NOT escaped (but a sanitization is done) |
|
105 | 105 | } elseif ($function == 'imagegeneration') { |
106 | 106 | // TODO |
107 | 107 | } elseif ($function == 'videogeneration') { |
@@ -110,6 +110,6 @@ discard block |
||
110 | 110 | // TODO |
111 | 111 | } else { |
112 | 112 | // Default case 'textgeneration' |
113 | - print dolPrintText($generatedContent); // Note that common HTML tags are NOT escaped (but a sanitization is done) |
|
113 | + print dolPrintText($generatedContent); // Note that common HTML tags are NOT escaped (but a sanitization is done) |
|
114 | 114 | } |
115 | 115 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | // Parameters |
46 | 46 | $action = GETPOST('action', 'aZ09'); |
47 | 47 | $backtopage = GETPOST('backtopage', 'alpha'); |
48 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
48 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
49 | 49 | |
50 | 50 | if (empty($action)) { |
51 | 51 | $action = 'edit'; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | // List all available features |
73 | 73 | $arrayofaifeatures = getListOfAIFeatures(); |
74 | 74 | |
75 | -$item = $formSetup->newItem('AI_API_SERVICE'); // Name of constant must end with _KEY so it is encrypted when saved into database. |
|
75 | +$item = $formSetup->newItem('AI_API_SERVICE'); // Name of constant must end with _KEY so it is encrypted when saved into database. |
|
76 | 76 | $item->setAsSelect($arrayofia); |
77 | 77 | $item->cssClass = 'minwidth150'; |
78 | 78 | |
@@ -82,14 +82,14 @@ discard block |
||
82 | 82 | $item->defaultFieldValue = ''; |
83 | 83 | $item->cssClass = 'minwidth500';*/ |
84 | 84 | |
85 | - $item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_KEY')->setAsSecureKey(); // Name of constant must end with _KEY so it is encrypted when saved into database. |
|
85 | + $item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_KEY')->setAsSecureKey(); // Name of constant must end with _KEY so it is encrypted when saved into database. |
|
86 | 86 | $item->nameText = $langs->trans("AI_API_KEY").' ('.$ialabel.')'; |
87 | 87 | $item->defaultFieldValue = ''; |
88 | 88 | $item->fieldParams['hideGenerateButton'] = 1; |
89 | 89 | $item->fieldParams['trClass'] = 'iaservice '.$ia; |
90 | 90 | $item->cssClass = 'minwidth500 text-security input'.$ia; |
91 | 91 | |
92 | - $item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_URL'); // Name of constant must end with _KEY so it is encrypted when saved into database. |
|
92 | + $item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_URL'); // Name of constant must end with _KEY so it is encrypted when saved into database. |
|
93 | 93 | $item->nameText = $langs->trans("AI_API_URL").' ('.$ialabel.')'; |
94 | 94 | $item->defaultFieldValue = ''; |
95 | 95 | $item->fieldParams['trClass'] = 'iaservice '.$ia; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $out = ''; |
194 | 194 | |
195 | 195 | //if ($functioncode) { |
196 | - $key = 'textgenerationother'; // The HTML ID of field to fill |
|
196 | + $key = 'textgenerationother'; // The HTML ID of field to fill |
|
197 | 197 | |
198 | 198 | $labeloffeature = empty($arrayofaifeatures[$key]['label']) ? 'Undefined' : $arrayofaifeatures[$key]['label']; |
199 | 199 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $formai = new FormAI($db); |
210 | 210 | $formmail = new FormMail($db); |
211 | 211 | |
212 | - $showlinktoai = $key; // 'textgeneration', 'imagegeneration', ... |
|
212 | + $showlinktoai = $key; // 'textgeneration', 'imagegeneration', ... |
|
213 | 213 | $showlinktoailabel = $langs->trans("AITestText"); |
214 | 214 | $showlinktolayout = 0; |
215 | 215 | $htmlname = $key; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | // Fill $out |
218 | 218 | include DOL_DOCUMENT_ROOT.'/core/tpl/formlayoutai.tpl.php'; |
219 | 219 | |
220 | - $out .= '<br><textarea id="'.$key.'" placeholder="Lore ipsum..." class="quatrevingtpercent" rows="4"></textarea>'; // The div |
|
220 | + $out .= '<br><textarea id="'.$key.'" placeholder="Lore ipsum..." class="quatrevingtpercent" rows="4"></textarea>'; // The div |
|
221 | 221 | //} |
222 | 222 | |
223 | 223 | /* |