Looks good to me - thanks!


On Thu, Jun 27, 2013 at 8:27 AM, Shad Laws <notifications@github.com> wrote:

> In modules/gallery/classes/Gallery/Model/Item.php:
>
> > @@ -27,7 +27,7 @@ public function __construct($id=null) {
> >      if (!$this->loaded()) {
> >        // Set reasonable defaults
> >        $this->created = time();
> > -      $this->rand_key = Random::percent();
> > +      $this->rand_key = sprintf("%f", Random::percent());  // sprintf to prevent things like 2.1E-6
>
> Audited the code - in gallery3 and gallery3-contrib, we only ever use this
> to set the rand_key and then use it for random queries. With that context
> in mind, I changed Random::percent() and returned Model_Item::__construct()
> back to the way it was:
> 9c3ac11<https://github.com/gallery/gallery3/commit/9c3ac112e3e1f4939916f6f039f6e1dbbe14aaad>
>
> I chose 10 as the default number of digits because, well, that's how we
> defined the items table :-)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/gallery/gallery3/pull/430/files#r4914412>
> .
>