diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index c433043b6c5..13f34b955bd 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -61,7 +61,7 @@ if (empty($argv[1])) { $outputpath = $argv[1]; $outputdir = dirname($outputpath); $outputfile = basename($outputpath); -$outputfilerss = preg_replace('/\.\w+$/i', '', $outputfile).'-security.rss'; +$outputfilerss = preg_replace('/\.\w+$/i', '', $outputfile).'-security.rss'; // Replace the .html by -security.rss if (!is_dir($outputdir)) { print 'Error: dir '.$outputdir.' does not exists or is not writable'."\n"; @@ -271,7 +271,7 @@ $nbofmonth = 6; $delay = (3600 * 24 * 30 * $nbofmonth); $arrayofalerts = array(); -$commandcheck = "git log --all --shortstat --no-renames --use-mailmap --pretty=".escapeshellarg('format:%cI;%H;%aN;%aE;%ce;%s')." --since=".escapeshellarg(dol_print_date(dol_now() - $delay, '%Y-%m-%d'))." | grep -i -E ".escapeshellarg("(#yogosha|CVE|Sec:|Sec |Sec$)"); +$commandcheck = "git log --all --shortstat --no-renames --use-mailmap --pretty=".escapeshellarg('format:%cI;%H;%aN;%aE;%ce;%s')." --since=".escapeshellarg(dol_print_date(dol_now() - $delay, '%Y-%m-%d'))." | grep -i -E ".escapeshellarg("(#yogosha|CVE|Sec:|Sec |^Sec$)"); print 'Execute git log to get commits related to security: '.$commandcheck."\n"; $output_arrglpu = array(); $resexecglpu = 0; @@ -280,7 +280,7 @@ foreach ($output_arrglpu as $valgitlog) { // The most recent lines are first. // Parse the line to split interesting data $tmpval = cleanVal2($valgitlog); - if (preg_match('/(#yogosha|CVE[\s\-]*\d|Sec:|Sec\s|Sec$)/i', $tmpval['title'])) { // Recommended git comment: "Sec: Fix #..." + if (preg_match('/(#yogosha|CVE[\s\-]*\d|Sec:|Sec\s|^Sec$)/i', $tmpval['title'])) { // Recommended git comment: "Sec: Fix #..." $alreadyfound = ''; $alreadyfoundcommitid = ''; foreach ($arrayofalerts as $val) { // Loop on already found alerts @@ -932,7 +932,7 @@ $html .= ''; $html .= ''; $html .= '
'; -$html .= 'Note:Search is done in git repository on regex string "#yogosha|CVE[\s\-]*\d|Sec:|Sec\s" (not case sensitive)
'; +$html .= 'Note:Search is done in git repository on regex string "#yogosha|CVE[\s\-]*\d|Sec:|Sec |^Sec\s" (not case sensitive)
'; $html .= 'You can use this URL for RSS notifications: '.$outputfilerss.'

'; $html .= ''; diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index 3eebd71138e..e2699ca51d8 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -121,10 +121,9 @@ print ''.$langs->trans("BlockedLogDesc")."
trans("UnalterableLogTool1").'
'; if ($mysoc->country_code == 'FR') { $htmltext = $langs->trans("UnalterableLogTool1FR").'
'; + print info_admin($htmltext, 0, 0, 'warning'); } -print info_admin($htmltext, 0, 0, 'warning'); - print '
'; print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 39a070b4cf8..ae8ea1ab4bd 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -801,7 +801,8 @@ if ($sql) { print '
'; $parameters = array('user' => $user); -$reshook = $hookmanager->executeHooks('dashboardAccountancy', $parameters, $object); // Note that $action and $object may have been modified by hook +$object = null; +$reshook = $hookmanager->executeHooks('dashboardAccountancy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook // End of page llxFooter(); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 39ef25cb706..ab80518641f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9874,7 +9874,7 @@ abstract class CommonObject } } - if (empty($buyPrice) && isset($conf->global->MARGIN_TYPE) && in_array($conf->global->MARGIN_TYPE, array('1', 'pmp', 'costprice'))) { + if (empty($buyPrice) && in_array(getDolGlobalString('MARGIN_TYPE'), array('1', 'pmp', 'costprice'))) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $productFournisseur = new ProductFournisseur($this->db); if (($result = $productFournisseur->find_min_price_product_fournisseur($fk_product)) > 0) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c1575a91f69..5736d0a50d9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7579,7 +7579,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ //print $amount."-"; $data = explode('.', $amount); $decpart = isset($data[1]) ? $data[1] : ''; - $decpart = preg_replace('/0+$/i', '', $decpart); // Supprime les 0 de fin de partie decimale + $decpart = preg_replace('/0+$/i', '', $decpart); // Remove 0 at end of decimal part //print "decpart=".$decpart."
"; $end = ''; @@ -7662,7 +7662,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ */ function price2num($amount, $rounding = '', $option = 0) { - global $langs, $conf; + global $langs; // Clean parameters if (is_null($amount)) { @@ -12698,7 +12698,6 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, function printCommonFooter($zone = 'private') { global $conf, $hookmanager, $user, $langs; - global $debugbar; global $action; global $micro_start_time; @@ -12712,8 +12711,9 @@ function printCommonFooter($zone = 'private') print "\n\n"; print '' . "\n"; - $parameters = array(); - $reshook = $hookmanager->executeHooks('printCommonFooter', $parameters); // Note that $action and $object may have been modified by some hooks + $parameters = array('zone' => $zone); + $tmpobject = null; + $reshook = $hookmanager->executeHooks('printCommonFooter', $parameters, $tmpobject, $action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { if (getDolGlobalString('MAIN_HTML_FOOTER')) { print getDolGlobalString('MAIN_HTML_FOOTER') . "\n"; @@ -12907,7 +12907,7 @@ function printCommonFooter($zone = 'private') print "\n" . '' . "\n"; // Google Analytics - // TODO Add a hook here + // TODO Remove this, can be replaced with the hook printCommonFooter if (isModEnabled('google') && getDolGlobalString('MAIN_GOOGLE_AN_ID')) { $tmptagarray = explode(',', getDolGlobalString('MAIN_GOOGLE_AN_ID')); foreach ($tmptagarray as $tmptag) { @@ -12933,15 +12933,23 @@ function printCommonFooter($zone = 'private') print_r(xdebug_get_code_coverage()); } + // Output string from hooks + if (!empty($hookmanager->resPrint)) { + print $hookmanager->resPrint; + } + // Add DebugBar data - if ($user->hasRight('debugbar', 'read') && $debugbar instanceof DebugBar\DebugBar) { - if (isset($debugbar['time'])) { - // @phan-suppress-next-line PhanPluginUnknownObjectMethodCall - $debugbar['time']->stopMeasure('pageaftermaster'); + if ($user->hasRight('debugbar', 'read')) { + global $debugbar; + if ($debugbar instanceof DebugBar\DebugBar) { + if (isset($debugbar['time'])) { + // @phan-suppress-next-line PhanPluginUnknownObjectMethodCall + $debugbar['time']->stopMeasure('pageaftermaster'); + } + print '' . "\n"; + $renderer = $debugbar->getJavascriptRenderer(); + print $renderer->render(); } - print '' . "\n"; - $renderer = $debugbar->getJavascriptRenderer(); - print $renderer->render(); } elseif (count($conf->logbuffer)) { // If there is some logs in buffer to show print "\n"; print "