mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix php8 compatibility
This commit is contained in:
parent
857048c9bd
commit
40720fad25
|
|
@ -358,7 +358,7 @@ if ($action == 'create') {
|
|||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||
print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), 1);
|
||||
print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100');
|
||||
print '</td></tr>';
|
||||
|
||||
// Morphy
|
||||
|
|
@ -375,7 +375,7 @@ if ($action == 'create') {
|
|||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>';
|
||||
print '<input name="amount" size="5" value="'.price($amount).'">';
|
||||
print '<input name="amount" size="5" value="'.(GETPOSTISSET('amount') ? GETPOST('amount') : price($amount)).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
|
|
@ -389,12 +389,12 @@ if ($action == 'create') {
|
|||
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('comment', $object->note, '', 200, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
|
||||
$doleditor = new DolEditor('comment', (GETPOSTISSET('comment') ? GETPOST('comment', 'restricthtml') : $object->note_public), '', 200, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 250, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
|
||||
$doleditor = new DolEditor('mail_valid', GETPOSTISSET('mail_valid') ? GETPOST('mail_valid') : $object->mail_valid, '', 250, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ abstract class CommonStickerGenerator
|
|||
// phpcs:enable
|
||||
$this->_Metric = $format['metric'];
|
||||
$this->_Avery_Name = $format['name'];
|
||||
$this->_Avery_Code = $format['code'];
|
||||
$this->_Avery_Code = empty($format['code'])?'':$format['code'];
|
||||
$this->_Margin_Left = $this->convertMetric($format['marginLeft'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_Margin_Top = $this->convertMetric($format['marginTop'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_X_Space = $this->convertMetric($format['SpaceX'], $this->_Metric, $this->_Metric_Doc);
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class pdf_standardlabel extends CommonStickerGenerator
|
|||
$widthtouse = $maxwidthtouse;
|
||||
$heighttouse = 0; // old value for image
|
||||
$tmp = dol_getImageSize($photo, false);
|
||||
if ($tmp['height']) {
|
||||
if (!empty($tmp['height'])) {
|
||||
$imgratio = $tmp['width'] / $tmp['height'];
|
||||
if ($imgratio >= $defaultratio) {
|
||||
$widthtouse = $maxwidthtouse;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ if (!is_object($form)) {
|
|||
?>
|
||||
<!-- BEGIN PHP TEMPLATE extrafields_view.tpl.php -->
|
||||
<?php
|
||||
if (!is_array($parameters)) {
|
||||
if (!isset($parameters) || !is_array($parameters)) {
|
||||
$parameters = array();
|
||||
}
|
||||
if (!empty($cols)) {
|
||||
|
|
|
|||
|
|
@ -541,10 +541,11 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
|
|||
}
|
||||
|
||||
$sessiontokenforthisurl = (empty($_SESSION['token']) ? '' : $_SESSION['token']);
|
||||
// TODO Get the sessiontokenforthisurl into the array of session token
|
||||
// TODO Get the sessiontokenforthisurl into an array of session token (one array per base URL so we can use the CSRF per page and we keep ability for several tabs per url in a browser)
|
||||
if (GETPOSTISSET('token') && GETPOST('token') != 'notrequired' && GETPOST('token', 'alpha') != $sessiontokenforthisurl) {
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (invalid token), so we disable POST and some GET parameters - referer=".$_SERVER['HTTP_REFERER'].", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING);
|
||||
//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.
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (invalid token), so we disable POST and some GET parameters - referer=".$_SERVER['HTTP_REFERER'].", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha'), LOG_WARNING);
|
||||
//dol_syslog("_SESSION['token']=".$sessiontokenforthisurl, LOG_DEBUG);
|
||||
// Do not output anything on standard output because this create problems when using the BACK button on browsers. So we just set a message into session.
|
||||
setEventMessages('SecurityTokenHasExpiredSoActionHasBeenCanceledPleaseRetry', null, 'warnings');
|
||||
$savid = null;
|
||||
if (isset($_POST['id'])) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user