From 83c04db0ef21d5bad0cec36c212c6c1b1cecc850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 15 May 2024 18:07:05 +0200 Subject: [PATCH] fix phpunit (#29696) * fix phpunit * fix phpunit * fix phpunit --- htdocs/categories/photos.php | 3 ++- htdocs/webhook/ajax/webhook.php | 3 ++- htdocs/webhook/target_card.php | 20 ++------------------ 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index f44052afbd8..8b47e14e4bc 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -83,7 +84,7 @@ if (empty($reshook)) { if (is_array($file['name']) && count($file['name']) > 0) { foreach ($file['name'] as $i => $name) { if (empty($file['tmp_name'][$i]) || (getDolGlobalInt('MAIN_UPLOAD_DOC') * 1000) <= filesize($file['tmp_name'][$i])) { - setEventMessage($file['name'][$i].' : '.$langs->trans(empty($file['tmp_name'][$i]) ? 'ErrorFailedToSaveFile' : 'MaxSizeForUploadedFiles')); + setEventMessage($file['name'][$i].' : '.$langs->trans(empty($file['tmp_name'][$i]) ? 'ErrorFailedToSaveFile' : 'MaxSizeForUploadedFiles'), 'errors'); unset($file['name'][$i], $file['type'][$i], $file['tmp_name'][$i], $file['error'][$i], $file['size'][$i]); } } diff --git a/htdocs/webhook/ajax/webhook.php b/htdocs/webhook/ajax/webhook.php index 399aebc1779..d3007781a5f 100644 --- a/htdocs/webhook/ajax/webhook.php +++ b/htdocs/webhook/ajax/webhook.php @@ -1,5 +1,6 @@ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index 7fa9ecd2e15..7969b088987 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -99,7 +99,7 @@ $upload_dir = $conf->webhook->multidir_output[isset($object->entity) ? $object-> //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->webhook->enabled)) { +if (!isModEnabled('webhook')) { accessforbidden(); } if (!$permissiontoread) { @@ -159,7 +159,7 @@ if (empty($reshook)) { if ($action == 'testsendtourl' && $permissiontoadd) { $triggercode = GETPOST("triggercode"); $url = GETPOST("url"); - $jsondata = GETPOST("jsondata", "restrcithtml"); + $jsondata = GETPOST("jsondata", "restricthtml"); if (empty($url)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Url")), null, 'errors'); @@ -211,22 +211,6 @@ $help_url = ''; llxHeader('', $title, $help_url, '', 0, 0, $arrayofjs, $arrayofcss); -// Example : Adding jquery code -// print ''; - - // Part to create if ($action == 'create') { if (empty($permissiontoadd)) {