add new rule
This commit is contained in:
parent
4be4f975b0
commit
b70efb5d7b
@ -291,8 +291,8 @@ script:
|
|||||||
# Ensure we catch errors
|
# Ensure we catch errors
|
||||||
set -e
|
set -e
|
||||||
# Exclusions are defined in the ruleset.xml file
|
# 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 .
|
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
|
#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
|
set +e
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
|||||||
@ -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,
|
// 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.
|
// 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 = '';
|
$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.
|
// 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.
|
// 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
|
// 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))
|
if (!empty($dolibarr_strict_mode))
|
||||||
{
|
{
|
||||||
error_reporting(E_ALL | E_STRICT);
|
error_reporting(E_ALL | E_STRICT);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED));
|
error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,8 +152,7 @@ if (!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck))
|
|||||||
{
|
{
|
||||||
$csrfattack = false;
|
$csrfattack = false;
|
||||||
if (empty($_SERVER['HTTP_REFERER'])) $csrfattack = true; // An evil browser was used
|
if (empty($_SERVER['HTTP_REFERER'])) $csrfattack = true; // An evil browser was used
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$tmpa = parse_url($_SERVER['HTTP_HOST']);
|
$tmpa = parse_url($_SERVER['HTTP_HOST']);
|
||||||
$tmpb = parse_url($_SERVER['HTTP_REFERER']);
|
$tmpb = parse_url($_SERVER['HTTP_REFERER']);
|
||||||
if ((empty($tmpa['host']) ? $tmpa['path'] : $tmpa['host']) != (empty($tmpb['host']) ? $tmpb['path'] : $tmpb['host'])) $csrfattack = true;
|
if ((empty($tmpa['host']) ? $tmpa['path'] : $tmpa['host']) != (empty($tmpb['host']) ? $tmpb['path'] : $tmpb['host'])) $csrfattack = true;
|
||||||
|
|||||||
@ -110,8 +110,7 @@ if ($action == 'edit') {
|
|||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
} else
|
} else {
|
||||||
{
|
|
||||||
print '<br>'.$langs->trans("NothingToSetup");
|
print '<br>'.$langs->trans("NothingToSetup");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -398,7 +398,7 @@ class Hook extends CommonObject
|
|||||||
{
|
{
|
||||||
$result = $this->fetchCommon($id, $ref);
|
$result = $this->fetchCommon($id, $ref);
|
||||||
if ($result > 0 && !empty($this->table_element_line)) {
|
if ($result > 0 && !empty($this->table_element_line)) {
|
||||||
$this->fetchLines();
|
//$this->fetchLines();
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,9 +45,7 @@ if (GETPOST('actioncode', 'array'))
|
|||||||
{
|
{
|
||||||
$actioncode = GETPOST('actioncode', 'array', 3);
|
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||||
if (!count($actioncode)) $actioncode = '0';
|
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));
|
$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');
|
$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))
|
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>';
|
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>';
|
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -338,9 +338,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
if ($user->rights->mymodule->write)
|
if ($user->rights->mymodule->write)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&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";
|
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)
|
if ($user->rights->mymodule->delete)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&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";
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -132,9 +132,7 @@ if ($object->id)
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
accessforbidden('', 0, 0);
|
accessforbidden('', 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user