Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Changed from Request::instance() to Request::current() #26

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
8 changes: 4 additions & 4 deletions classes/captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@ public function image_render($html)
return '<img src="'.url::site('captcha/'.Captcha::$config['group']).'" width="'.Captcha::$config['width'].'" height="'.Captcha::$config['height'].'" alt="Captcha" class="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()->headers['Content-Type'] = 'image/'.$this->image_type;
Request::current()->headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0';
Request::current()->headers['Pragma'] = 'no-cache';
Request::current()->headers['Connection'] = 'close';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe like this?

// Send the correct HTTP header
Request::current()->response()
    ->headers('Content-Type', 'image/'.$this->image_type)
    ->headers('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0')
    ->headers('Pragma', 'no-cache')
    ->headers('Connection', 'close');


// Pick the correct output function
$function = 'image'.$this->image_type;
Expand Down