[-] BO : fix #PSCFV-2513
This commit is contained in:
@@ -39,7 +39,7 @@ class TranslateCore
|
|||||||
* @param bool $htmlentities
|
* @param bool $htmlentities
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function getAdminTranslation($string, $class = 'AdminTab', $addslashes = false, $htmlentities = true, $sprintf = false)
|
public static function getAdminTranslation($string, $class = 'AdminTab', $addslashes = false, $htmlentities = true, $sprintf = null)
|
||||||
{
|
{
|
||||||
static $modules_tabs = null;
|
static $modules_tabs = null;
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ class TranslateCore
|
|||||||
$str = $htmlentities ? htmlentities($str, ENT_QUOTES, 'utf-8') : $str;
|
$str = $htmlentities ? htmlentities($str, ENT_QUOTES, 'utf-8') : $str;
|
||||||
$str = str_replace('"', '"', $str);
|
$str = str_replace('"', '"', $str);
|
||||||
|
|
||||||
if ($sprintf)
|
if (preg_match_all('#(?:%%|%(?:[0-9]+\$)?[+-]?(?:[ 0]|\'.)?-?[0-9]*(?:\.[0-9]+)?[bcdeufFosxX])#', $str, $matches) && !is_null($sprintf))
|
||||||
{
|
{
|
||||||
if (!is_array($sprintf))
|
if (!is_array($sprintf))
|
||||||
$sprintf = array($sprintf);
|
$sprintf = array($sprintf);
|
||||||
@@ -121,7 +121,7 @@ class TranslateCore
|
|||||||
* @param string $source
|
* @param string $source
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function getModuleTranslation($module, $string, $source, $sprintf = false)
|
public static function getModuleTranslation($module, $string, $source, $sprintf = null)
|
||||||
{
|
{
|
||||||
global $_MODULES, $_MODULE, $_LANGADM;
|
global $_MODULES, $_MODULE, $_LANGADM;
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ class TranslateCore
|
|||||||
else
|
else
|
||||||
$ret = stripslashes($string);
|
$ret = stripslashes($string);
|
||||||
|
|
||||||
if ($sprintf)
|
if (preg_match_all('#(?:%%|%(?:[0-9]+\$)?[+-]?(?:[ 0]|\'.)?-?[0-9]*(?:\.[0-9]+)?[bcdeufFosxX])#', $ret, $matches) && !is_null($sprintf))
|
||||||
{
|
{
|
||||||
if (!is_array($sprintf))
|
if (!is_array($sprintf))
|
||||||
$sprintf = array($sprintf);
|
$sprintf = array($sprintf);
|
||||||
@@ -231,7 +231,7 @@ class TranslateCore
|
|||||||
|
|
||||||
$key = md5(str_replace('\'', '\\\'', $string));
|
$key = md5(str_replace('\'', '\\\'', $string));
|
||||||
|
|
||||||
$str = (key_exists('PDF'.$key, $_LANGPDF) ? $_LANGPDF['PDF'.$key] : $string);
|
$str = (array_key_exists('PDF'.$key, $_LANGPDF) ? $_LANGPDF['PDF'.$key] : $string);
|
||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user