* Fix wrong setting of sessionVar.

This commit is contained in:
Lufei
2023-05-22 14:43:32 +08:00
parent 43aba864b4
commit 72b53110dc
2 changed files with 6 additions and 4 deletions
+2
View File
@@ -2,3 +2,5 @@
$config->misc->api = 'https://api.zentao.net';
$config->misc->enApi = 'https://api.zentao.pm';
$config->misc->qucheng = 'https://www.qucheng.com';
$config->misc->disabledSessionVar = array('user', 'tutorialmode');
+4 -4
View File
@@ -179,7 +179,7 @@ class misc extends control
/**
* Show version changelog
* @access public
* @return viod
* @return void
*/
public function changeLog($version = '')
{
@@ -224,13 +224,13 @@ class misc extends control
* Show captcha and save to session.
*
* @param string $sessionVar
* @param string $uuid
* @access public
* @return void
*/
public function captcha($sessionVar = 'captcha', $uuid = '')
public function captcha($sessionVar = 'captcha')
{
if($sessionVar == 'user') die('The string user is not allowed to be defined as a session field.');
if(in_array(strtolower($sessionVar), $this->config->misc->disabledSessionVar)) die("The string {$sessionVar} is not allowed to be defined as a session field.");
$obLevel = ob_get_level();
for($i = 0; $i < $obLevel; $i++) ob_end_clean();