* Remove the sessionVar parameter to avoid session injection.

This commit is contained in:
liugang
2024-04-08 14:57:15 +08:00
parent 1bd2c8d5a8
commit 49061bb7f1
6 changed files with 12 additions and 17 deletions
+2 -5
View File
@@ -224,16 +224,13 @@ class misc extends control
* 展示验证码图片。
* Show captcha and save to session.
*
* @param string $sessionVar
* @access public
* @return void
*/
public function captcha(string $sessionVar = 'captcha')
public function captcha()
{
if(in_array(strtolower($sessionVar), $this->config->misc->disabledSessionVar)) die("The string {$sessionVar} is not allowed to be defined as a session field.");
$captcha = $this->app->loadClass('captcha');
$this->session->set($sessionVar, $captcha->getPhrase());
$this->session->set('captcha', $captcha->getPhrase());
$captcha->build();
$obLevel = ob_get_level();