diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-12-15 14:57:00 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-12-15 14:57:00 -0800 |
commit | cd48b89f3166e7fa732b5cb06d33fba018af9127 (patch) | |
tree | 9ad981df0d736dc186463aac4676fdba2bc232b8 /modules/digibug | |
parent | 45c63f4d118bfc99924edb8685442035349af6db (diff) |
Consolidate all the random code into a random helper that offers:
random::hash()
random::string()
random::percent()
random::int()
So that we don't have lots of different ways to get random values all
over the code. Follow-on to #1527.
Diffstat (limited to 'modules/digibug')
-rw-r--r-- | modules/digibug/controllers/digibug.php | 2 | ||||
-rw-r--r-- | modules/digibug/tests/Digibug_Controller_Test.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/digibug/controllers/digibug.php b/modules/digibug/controllers/digibug.php index a9e49de7..bc0c7c5e 100644 --- a/modules/digibug/controllers/digibug.php +++ b/modules/digibug/controllers/digibug.php @@ -28,7 +28,7 @@ class Digibug_Controller extends Controller { $thumb_url = $item->thumb_url(true); } else { $proxy = ORM::factory("digibug_proxy"); - $proxy->uuid = md5(mt_rand()); + $proxy->uuid = random::hash(); $proxy->item_id = $item->id; $proxy->save(); $full_url = url::abs_site("digibug/print_proxy/full/$proxy->uuid"); diff --git a/modules/digibug/tests/Digibug_Controller_Test.php b/modules/digibug/tests/Digibug_Controller_Test.php index 6f9e20df..d331b0ae 100644 --- a/modules/digibug/tests/Digibug_Controller_Test.php +++ b/modules/digibug/tests/Digibug_Controller_Test.php @@ -36,7 +36,7 @@ class Digibug_Controller_Test extends Gallery_Unit_Test_Case { access::deny(identity::registered_users(), "view_full", $album); $proxy = ORM::factory("digibug_proxy"); - $proxy->uuid = md5(mt_rand()); + $proxy->uuid = random::hash(); $proxy->item_id = $photo->id; return $proxy->save(); } |