diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-12-15 12:48:56 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-12-15 12:48:56 -0800 |
commit | 45c63f4d118bfc99924edb8685442035349af6db (patch) | |
tree | 995e248347743f905d7c8fc29343e88d74b31441 /modules/gallery/models | |
parent | 6fb0eb4e97e3bbfa50029f0b4249c10bd22abe09 (diff) |
Use mt_rand() instead of rand() since it provides better portability.
Fixes #1527.
Diffstat (limited to 'modules/gallery/models')
-rw-r--r-- | modules/gallery/models/item.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index a4d24b8f..b6713fc3 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -390,7 +390,7 @@ class Item_Model_Core extends ORM_MPTT { if (file_exists($this->resize_path()) || file_exists($this->thumb_path())) { $pi = pathinfo($this->name); - $this->name = $pi["filename"] . "-" . rand() . "." . $pi["extension"]; + $this->name = $pi["filename"] . "-" . mt_rand() . "." . $pi["extension"]; parent::save(); } @@ -512,7 +512,7 @@ class Item_Model_Core extends ORM_MPTT { ->or_where("slug", "=", $this->slug) ->close() ->find()->id) { - $rand = rand(); + $rand = mt_rand(); if ($base_ext) { $this->name = "$base_name-$rand.$base_ext"; } else { |