Skip to content
Extraits de code Groupes Projets
Valider 2b5d105d rédigé par mattpiwik's avatar mattpiwik
Parcourir les fichiers

Fixes #3132 The last bug was that the graph expects numbers, but we passing...

Fixes #3132 The last bug was that the graph expects numbers, but we passing strings containing currency symbol, which was casting as 0

git-svn-id: http://dev.piwik.org/svn/trunk@6432 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 63c6e8a3
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -325,7 +325,7 @@ class Piwik_ImageGraph_API ...@@ -325,7 +325,7 @@ class Piwik_ImageGraph_API
$hasData = true; $hasData = true;
if($parsedOrdinateValue != 0) if(!empty($parsedOrdinateValue))
{ {
$hasNonZeroValue = true; $hasNonZeroValue = true;
} }
...@@ -341,7 +341,6 @@ class Piwik_ImageGraph_API ...@@ -341,7 +341,6 @@ class Piwik_ImageGraph_API
$ordinateSerie[] = $parsedOrdinateValue; $ordinateSerie[] = $parsedOrdinateValue;
} }
} }
if(!$hasData || !$hasNonZeroValue) if(!$hasData || !$hasNonZeroValue)
{ {
throw new Exception(Piwik_Translate('General_NoDataForGraph')); throw new Exception(Piwik_Translate('General_NoDataForGraph'));
...@@ -424,6 +423,8 @@ class Piwik_ImageGraph_API ...@@ -424,6 +423,8 @@ class Piwik_ImageGraph_API
$ordinateValue = ($hour * 3600) + ($min * 60) + $sec; $ordinateValue = ($hour * 3600) + ($min * 60) + $sec;
} }
// OK, only numbers from here please (strip out currency sign)
$ordinateValue = preg_replace('/[^0-9.]/', '', $ordinateValue);
return $ordinateValue; return $ordinateValue;
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter