diff options
author | Nathan Kinkade <nkinkade@nkinka.de> | 2011-01-31 20:49:25 +0000 |
---|---|---|
committer | Nathan Kinkade <nkinkade@nkinka.de> | 2011-01-31 20:49:25 +0000 |
commit | de6f3fce9110b777d61dec97f2a3a61d887a5ccd (patch) | |
tree | 1a184dc0d6bbfd644164d85d3df1bc9926455da7 /modules/gallery/helpers/random.php | |
parent | 2898fe3b82ce10d045dd2c274a3290bacf209a00 (diff) | |
parent | d2c77fd0590501f7b6b51d9f4cc033ed9485b082 (diff) |
Did a git pull, but had to manually merge a conflict.
Diffstat (limited to 'modules/gallery/helpers/random.php')
-rw-r--r-- | modules/gallery/helpers/random.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/gallery/helpers/random.php b/modules/gallery/helpers/random.php index a26762bd..6016df7b 100644 --- a/modules/gallery/helpers/random.php +++ b/modules/gallery/helpers/random.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access."); /** * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2010 Bharat Mediratta + * Copyright (C) 2000-2011 Bharat Mediratta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,9 +42,13 @@ class random_Core { } /** - * Return a random number between 0 and mt_getrandmax() + * Return a random number between $min and $max. If $min and $max are not specified, + * return a random number between 0 and mt_getrandmax() */ - static function int() { + static function int($min=null, $max=null) { + if ($min || $max) { + return mt_rand($min, $max); + } return mt_rand(); } }
\ No newline at end of file |