Permalink
Browse files

When no cookie exists we don't wan't a notice

  • Loading branch information...
smgt committed Feb 13, 2012
1 parent 956b16a commit 54b4d60b5b03ca6a48ffddab717bf6bcacaa2f01
Showing with 8 additions and 2 deletions.
  1. +8 −2 phpab.php
View
@@ -179,7 +179,13 @@ public function get_user_segment ()
if($this->trial_mode == FALSE)
{
- $this->current_variation = $_COOKIE[$this->tag . '-' . $this->test_name];
+ $key = $this->tag . '-' . $this->test_name;
+ if(array_key_exists($key, $_COOKIE))
+ {
+ $this->current_variation = $_COOKIE[$key];
+ }
+
+ $this->current_variation = $_COOKIE[$key];
if(empty($this->current_variation))
{
$this->current_variation = '!unset';
@@ -288,4 +294,4 @@ public function run_test ()
$test_ran = TRUE;
}
-}
+}

0 comments on commit 54b4d60

Please sign in to comment.