Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f770f47 authored by Akhil's avatar Akhil 🙂
Browse files

Merge branch 'rollout-bug-fix' into 'master'

Bug-Fix: issue with 0 percentage rollout

See merge request !34
parents 24132ae5 a17dcd90
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -547,13 +547,14 @@
         */
        public function checkRollout()
        {
            $rolloutpercentage = isset($this->confProp['rollout']['percentage']) ? $this->confProp['rollout']['percentage'] : 100;
            if ($rolloutpercentage >= 0 && $rolloutpercentage < 100) {
                $rand_number = rand(0, 100);
                if ($rand_number > $rolloutpercentage) {
                    return false;
            $rolloutpercentage = isset($this->confProp['rollout']['percentage']) ? (int) $this->confProp['rollout']['percentage'] : 100;
            if ($rolloutpercentage <= 0 || $rolloutpercentage > 100) {
                return TRUE;
            }
            $rand_number = rand(1, 100);
            if ($rand_number > $rolloutpercentage) {
                return FALSE;
            }
            return true;
            return TRUE;
        }
    }
 No newline at end of file