diff options
author | benakamoorthi <benaka.moorthi@gmail.com> | 2012-12-15 05:32:38 +0400 |
---|---|---|
committer | benakamoorthi <benaka.moorthi@gmail.com> | 2012-12-15 05:32:38 +0400 |
commit | 9d80386c7af27909a920600f032638d779ac8974 (patch) | |
tree | b55d91292c8c11e6b2f9ab82141dc8a95c4e5a78 /plugins/ExampleUI | |
parent | a66f336f36c7d4ab9158f4937848a30441fea35f (diff) |
Fixes #3491, applying pebosi's patch to use mt_rand instead of rand.
git-svn-id: http://dev.piwik.org/svn/trunk@7627 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/ExampleUI')
-rw-r--r-- | plugins/ExampleUI/API.php | 4 | ||||
-rw-r--r-- | plugins/ExampleUI/Controller.php | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/plugins/ExampleUI/API.php b/plugins/ExampleUI/API.php index 07a1cb7202..190b2371fe 100644 --- a/plugins/ExampleUI/API.php +++ b/plugins/ExampleUI/API.php @@ -47,8 +47,8 @@ class Piwik_ExampleUI_API // to keep things simple, we generate the data foreach($period->getSubperiods() as $subPeriod) { - $server1 = rand(50,90); - $server2 = rand(40, 110); + $server1 = mt_rand(50,90); + $server2 = mt_rand(40, 110); $value = array('server1' => $server1, 'server2' => $server2); $temperatures[$subPeriod->getLocalizedShortString()] = $value; } diff --git a/plugins/ExampleUI/Controller.php b/plugins/ExampleUI/Controller.php index 3a0d18e1ba..f7a06f143c 100644 --- a/plugins/ExampleUI/Controller.php +++ b/plugins/ExampleUI/Controller.php @@ -104,11 +104,11 @@ class Piwik_ExampleUI_Controller extends Piwik_Controller function sparklines() { require_once PIWIK_INCLUDE_PATH . '/core/SmartyPlugins/function.sparkline.php'; - $srcSparkline1 = Piwik_Url::getCurrentQueryStringWithParametersModified(array('action'=>'generateSparkline', 'server' => 'server1', 'rand'=>rand())); + $srcSparkline1 = Piwik_Url::getCurrentQueryStringWithParametersModified(array('action'=>'generateSparkline', 'server' => 'server1', 'rand'=>mt_rand())); $htmlSparkline1 = smarty_function_sparkline(array('src' => $srcSparkline1)); echo "<div class='sparkline'>$htmlSparkline1 Evolution of temperature for server piwik.org</div>"; - $srcSparkline2 = Piwik_Url::getCurrentQueryStringWithParametersModified(array('action'=>'generateSparkline', 'server' => 'server2', 'rand'=>rand())); + $srcSparkline2 = Piwik_Url::getCurrentQueryStringWithParametersModified(array('action'=>'generateSparkline', 'server' => 'server2', 'rand'=>mt_rand())); $htmlSparkline2 = smarty_function_sparkline(array('src' => $srcSparkline2)); echo "<div class='sparkline'>$htmlSparkline2 Evolution of temperature for server dev.piwik.org</div>"; } |