From cbcc8ebb35e70ba82ca2bb6e49ca282ef88eb2a4 Mon Sep 17 00:00:00 2001 From: Rumata Estorsky Date: Mon, 18 Mar 2013 15:36:46 +0400 Subject: [PATCH 1/2] fix headers send (for Kohana >= 3.2) --- classes/captcha.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/captcha.php b/classes/captcha.php index 98dbc4a..36d6c4a 100644 --- a/classes/captcha.php +++ b/classes/captcha.php @@ -434,11 +434,11 @@ public function image_render($html) return 'Captcha'; // Send the correct HTTP header - Request::instance()->headers['Content-Type'] = 'image/'.$this->image_type; - Request::instance()->headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'; - Request::instance()->headers['Pragma'] = 'no-cache'; - Request::instance()->headers['Connection'] = 'close'; - + Request::current()->response()->headers('Content-Type', 'image/'.$this->image_type); + Request::current()->response()->headers('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); + Request::current()->response()->headers('Pragma', 'no-cache'); + Request::current()->response()->headers('Connection', 'close'); + // Pick the correct output function $function = 'image'.$this->image_type; $function($this->image); From 2b679f690a9d6689f8fb7dc28316b65bd541e632 Mon Sep 17 00:00:00 2001 From: Rumata Estorsky Date: Mon, 18 Mar 2013 15:40:58 +0400 Subject: [PATCH 2/2] fix captcha math module --- classes/captcha/math.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/captcha/math.php b/classes/captcha/math.php index 77ea427..8dbb779 100644 --- a/classes/captcha/math.php +++ b/classes/captcha/math.php @@ -58,6 +58,7 @@ public function generate_challenge() */ public function render($html = TRUE) { + $this->update_response_session(); return $this->math_exercise; }