Permalink
Browse files

Merge pull request #1 from simon/master

Fix a few PHP notices
  • Loading branch information...
Brian Cray
Brian Cray committed Feb 13, 2012
2 parents 089d739 + 8b98bef commit eab6a3abd7f3492e8a2972d9472e7a94b9593261
Showing with 8 additions and 3 deletions.
  1. +8 −3 phpab.php
View
@@ -178,7 +178,12 @@ 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];
+ }
+
if(empty($this->current_variation))
{
$this->current_variation = '!unset';
@@ -218,7 +223,7 @@ public function execute ($buffer)
{
$this->content = $buffer;
- if($test_ran == FALSE)
+ if($this->test_ran == FALSE)
{
$this->run_test();
}
@@ -285,6 +290,6 @@ public function run_test ()
$test_close = strpos($this->content, $close_tag, $test_open);
}
- $test_ran = TRUE;
+ $this->test_ran = TRUE;
}
}

0 comments on commit eab6a3a

Please sign in to comment.