add new rule

This commit is contained in:
Frédéric FRANCE 2020-05-21 01:10:33 +02:00
parent 4be4f975b0
commit b70efb5d7b
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
7 changed files with 12 additions and 28 deletions

View File

@ -291,8 +291,8 @@ script:
# Ensure we catch errors
set -e
# Exclusions are defined in the ruleset.xml file
#phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
#if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
set +e
echo

View File

@ -87,9 +87,7 @@ if (!$result && !empty($_SERVER["GATEWAY_INTERFACE"])) // If install not done
// Note: If calling page was an index.php not into htdocs (ie comm/index.php, ...), then this redirect will fails,
// but we don't want to change this because when URL is correct, we must be sure the redirect to install/index.php will be correct.
$path = '';
}
else
{
} else {
// If what we look is not index.php, we can try to guess location of root. May not work all the time.
// There is no real solution, because the only way to know the apache url relative path is to have it into conf file.
// If it fails to find correct $path, then only solution is to ask user to enter the correct URL to index.php or install/index.php
@ -114,9 +112,7 @@ if (!$result && !empty($_SERVER["GATEWAY_INTERFACE"])) // If install not done
if (!empty($dolibarr_strict_mode))
{
error_reporting(E_ALL | E_STRICT);
}
else
{
} else {
error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED));
}
@ -156,8 +152,7 @@ if (!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck))
{
$csrfattack = false;
if (empty($_SERVER['HTTP_REFERER'])) $csrfattack = true; // An evil browser was used
else
{
else {
$tmpa = parse_url($_SERVER['HTTP_HOST']);
$tmpb = parse_url($_SERVER['HTTP_REFERER']);
if ((empty($tmpa['host']) ? $tmpa['path'] : $tmpa['host']) != (empty($tmpb['host']) ? $tmpb['path'] : $tmpb['host'])) $csrfattack = true;

View File

@ -110,8 +110,7 @@ if ($action == 'edit') {
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
print '</div>';
} else
{
} else {
print '<br>'.$langs->trans("NothingToSetup");
}
}

View File

@ -398,7 +398,7 @@ class Hook extends CommonObject
{
$result = $this->fetchCommon($id, $ref);
if ($result > 0 && !empty($this->table_element_line)) {
$this->fetchLines();
//$this->fetchLines();
}
return $result;
}

View File

@ -45,9 +45,7 @@ if (GETPOST('actioncode', 'array'))
{
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0';
}
else
{
} else {
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
}
$search_agenda_label = GETPOST('search_agenda_label');
@ -217,9 +215,7 @@ if ($object->id > 0)
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create))
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
}
else
{
} else {
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
}
}

View File

@ -338,9 +338,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($user->rights->mymodule->write)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a>'."\n";
}
else
{
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
}
@ -367,9 +365,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($user->rights->mymodule->delete)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>'."\n";
}
else
{
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
}
}

View File

@ -132,9 +132,7 @@ if ($object->id)
print '</div>';
dol_fiche_end();
}
else
{
} else {
accessforbidden('', 0, 0);
}