MAJ en Thelia 2.3.4
This commit is contained in:
@@ -75,6 +75,7 @@ class FileDownloader implements FileDownloaderInterface
|
||||
*/
|
||||
$con = curl_init($url);
|
||||
curl_setopt($con, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($con, CURLOPT_FOLLOWLOCATION, true);
|
||||
|
||||
$response = curl_exec($con);
|
||||
$errno = curl_errno($con);
|
||||
|
||||
@@ -51,13 +51,13 @@ class NumberFormat
|
||||
{
|
||||
$lang = $this->request->getSession()->getLang();
|
||||
|
||||
if ($decimals == null) {
|
||||
if ($decimals === null) {
|
||||
$decimals = $lang->getDecimals();
|
||||
}
|
||||
if ($decPoint == null) {
|
||||
if ($decPoint === null) {
|
||||
$decPoint = $lang->getDecimalSeparator();
|
||||
}
|
||||
if ($thousandsSep == null) {
|
||||
if ($thousandsSep === null) {
|
||||
$thousandsSep = $lang->getThousandsSeparator();
|
||||
}
|
||||
return number_format($number, $decimals, $decPoint, $thousandsSep);
|
||||
|
||||
@@ -82,7 +82,7 @@ class TokenProvider
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $entryValue
|
||||
* @param string $entryValue
|
||||
* @return bool
|
||||
* @throws \Thelia\Core\Security\Exception\TokenAuthenticationException
|
||||
*/
|
||||
@@ -92,14 +92,10 @@ class TokenProvider
|
||||
throw new TokenAuthenticationException(
|
||||
"Tried to check a token without assigning it before"
|
||||
);
|
||||
} else {
|
||||
if ($this->token !== $entryValue) {
|
||||
throw new TokenAuthenticationException(
|
||||
"Tried to validate an invalid token"
|
||||
);
|
||||
} else {
|
||||
$this->refreshToken();
|
||||
}
|
||||
} elseif ($this->token !== $entryValue) {
|
||||
throw new TokenAuthenticationException(
|
||||
"Tried to validate an invalid token"
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -118,6 +114,7 @@ class TokenProvider
|
||||
{
|
||||
return self::generateToken();
|
||||
}
|
||||
|
||||
/**
|
||||
* Same method as getToken but can be called statically
|
||||
*
|
||||
|
||||
@@ -174,7 +174,7 @@ class URL
|
||||
if (! is_null($parameters)) {
|
||||
foreach ($parameters as $name => $value) {
|
||||
// Remove this parameter from base URL to prevent duplicate parameters
|
||||
$base = preg_replace('/([?&])'.$name.'=(?:[^&]*)(?:&|$)/', '$1', $base);
|
||||
$base = preg_replace('`([?&])'.preg_quote($name, '`').'=(?:[^&]*)(?:&|$)`', '$1', $base);
|
||||
|
||||
$queryString .= sprintf("%s=%s&", urlencode($name), urlencode($value));
|
||||
}
|
||||
|
||||
@@ -103,8 +103,9 @@ class Version
|
||||
*/
|
||||
public static function parse($version = null)
|
||||
{
|
||||
if (is_null($version))
|
||||
if (is_null($version)) {
|
||||
$version = \Thelia\Core\Thelia::THELIA_VERSION;
|
||||
}
|
||||
|
||||
$pattern = "`^(?<version>
|
||||
(?<major>[0-9]+)\.
|
||||
@@ -112,6 +113,7 @@ class Version
|
||||
(?<release>[0-9]+)
|
||||
-?(?<extra>[a-zA-Z0-9]*) # extra_version will also match empty string
|
||||
)$`x";
|
||||
|
||||
if (!preg_match($pattern, $version, $match)) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf(
|
||||
|
||||
Reference in New Issue
Block a user