Skip to content

Commit

Permalink
Merge branch 'develop' into fix/PhanTypeInvalidPropertyName
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Mar 24, 2024
2 parents f357056 + 295587e commit 1cc126b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion htdocs/admin/stock.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(), null, 0, 0, 0, 2, 1, '', '', 'reposition');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE);
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE'));
}
} else {
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name")).'</span>';
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -6763,7 +6763,7 @@ function get_localtax_by_third($local)
*/
function getTaxesFromId($vatrate, $buyer = null, $seller = null, $firstparamisid = 1)
{
global $db, $mysoc;
global $db;

dol_syslog("getTaxesFromId vat id or rate = ".$vatrate);

Expand Down Expand Up @@ -6891,13 +6891,13 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi

/**
* Return vat rate of a product in a particular country, or default country vat if product is unknown.
* Function called by get_default_tva().
* Function called by get_default_tva(). Do not use this function directly, prefer to use get_default_tva().
*
* @param int $idprod Id of product or 0 if not a predefined product
* @param Societe $thirdpartytouse Thirdparty with a ->country_code defined (FR, US, IT, ...)
* @param int $idprodfournprice Id product_fournisseur_price (for "supplier" proposal/order/invoice)
* @return float|string Vat rate to use with format 5.0 or '5.0 (XXX)'
* @see get_product_localtax_for_country()
* @see get_default_tva(), get_product_localtax_for_country()
*/
function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournprice = 0)
{
Expand Down Expand Up @@ -7064,7 +7064,7 @@ function get_product_localtax_for_country($idprod, $local, $thirdpartytouse)
* @param int $idprod Id product
* @param int $idprodfournprice Id product_fournisseur_price (for supplier order/invoice)
* @return float|string Vat rate to use with format 5.0 or '5.0 (XXX)', -1 if we can't guess it
* @see get_default_npr(), get_default_localtax()
* @see get_default_localtax(), get_default_npr()
*/
function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod = 0, $idprodfournprice = 0)
{
Expand Down
8 changes: 4 additions & 4 deletions htdocs/expedition/class/expedition.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1219,8 +1219,8 @@ public function cancel($notrigger = 0, $also_update_stock = false)

// Stock control
if (!$error && isModEnabled('stock') &&
(($conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) ||
($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE && $this->statut == self::STATUS_CLOSED && $also_update_stock))) {
((getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT') && $this->statut > self::STATUS_DRAFT) ||
(getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE') && $this->statut == self::STATUS_CLOSED && $also_update_stock))) {
require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php";

$langs->load("agenda");
Expand Down Expand Up @@ -1416,8 +1416,8 @@ public function delete($user = null, $notrigger = 0, $also_update_stock = false)

// Stock control
if (!$error && isModEnabled('stock') &&
(($conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) ||
($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE && $this->statut == self::STATUS_CLOSED && $also_update_stock))) {
((getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT') && $this->statut > self::STATUS_DRAFT) ||
(getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE') && $this->statut == self::STATUS_CLOSED && $also_update_stock))) {
require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php";

$langs->load("agenda");
Expand Down
4 changes: 4 additions & 0 deletions test/phpunit/SecurityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,10 @@ public function testDolEval()
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';

$result = dol_eval('1==\x01', 1, 0); // Check that we can't make dol_eval on string containing \ char.
print "result0 = ".$result."\n";
$this->assertStringContainsString('Bad string syntax to evaluate', $result);

$result = dol_eval('1==1', 1, 0);
print "result1 = ".$result."\n";
$this->assertTrue($result);
Expand Down

0 comments on commit 1cc126b

Please sign in to comment.