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/gallery/helpers/gallery_installer.php | |
| 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/gallery/helpers/gallery_installer.php')
| -rw-r--r-- | modules/gallery/helpers/gallery_installer.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 9c42caad..a6b8e6a2 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -459,7 +459,7 @@ class gallery_installer { $blocks = block_manager::get_active($location); $new_blocks = array(); foreach ($blocks as $block) { - $new_blocks[mt_rand()] = $block; + $new_blocks[random::int()] = $block; } block_manager::set_active($location, $new_blocks); } @@ -507,7 +507,7 @@ class gallery_installer { ->execute() as $row) { $new_slug = item::convert_filename_to_slug($row->slug); if (empty($new_slug)) { - $new_slug = mt_rand(); + $new_slug = random::int(); } db::build() ->update("items") |
