diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index b836a10eea3..7a1e2210a78 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -152,7 +152,6 @@ $listofchoices = array( * Actions */ - //$parameters = array('socid' => $id); //$reshook = $hookmanager->executeHooks('doActions', $parameters, $object); // Note that $object may have been modified by some hooks //if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -162,7 +161,7 @@ $filesarray = array(); '@phan-var-force array $filesarray'; $result = false; -if (($action == 'searchfiles' || $action == 'dl')) { +if ($action == 'searchfiles' || $action == 'dl') { // Test on pemrission not required here. Test is done per object type later. if (empty($date_start)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart")), null, 'errors'); $error++; diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index f4b328cfa72..4e4b19d6f54 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -87,6 +87,13 @@ if (preg_match('/stat[u][st]$/', $field) || ($field == 'evenunsubscribe' && $obj } +/* + * Actions + */ + +// None + + /* * View */ @@ -96,7 +103,7 @@ top_httphead(); print ''."\n"; // Registering new values -if (($action == 'set') && !empty($id)) { +if (($action == 'set') && !empty($id)) { // Test on permission already done in header according to object and field. $triggerkey = strtoupper(($module != $element ? $module.'_' : '').$element).'_UPDATE'; // Special case if ($triggerkey == 'SOCIETE_UPDATE') { diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 5c483b626a8..ff41f36dbc4 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -189,7 +189,7 @@ if (empty($reshook)) { } if (($action == 'add' || ($action == 'update' && $object->status < Ticket::STATUS_CLOSED)) && $permissiontoadd) { - $ifErrorAction = ($action == 'add' ? 'create' : 'edit'); + $ifErrorAction = ($action == 'add' ? 'create' : 'edit'); // Test on permission not required here if ($action == 'add') { // Test on permission already done $object->track_id = null; } diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 6dc4c94dfbc..fa7cccf304e 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -662,7 +662,7 @@ class CodingPhpTest extends CommonClassTest $filecontentaction = $filecontent; } - preg_match_all('/if\s*\(\s*\$action\s*==\s*[\'"][a-z]+[\'"].*/', $filecontentaction, $matches, PREG_SET_ORDER); + preg_match_all('/if.*\(\s*\$action\s*==\s*[\'"][a-z]+[\'"].*/', $filecontentaction, $matches, PREG_SET_ORDER); foreach ($matches as $key => $val) { if (!preg_match('/\$user->hasR/', $val[0]) && !preg_match('/\$permission/', $val[0])