This article mainly introduces the solution to the error Request var not allow! when DedeCMS adds variables. This article gives a method to modify the PHP file. If you really can’t solve the problem, you can try this article. The method, friends in need can refer to it
Many people on the forum have reported that the "Request var not allow!" bug will appear when adding new variables in the background. This article mainly introduces how to solve this problem! Let’s look at the specific operations:
Open the include/common.inc.php file in the DEDE root directory and find the following content:
The code is as follows:
//检查和注册外部提交的变量 function CheckRequest(&$val) { if (is_ array ($val)) { foreach ($val as $_k=>$_v) { CheckRequest($_k); CheckRequest($val[$_k]); } } else { if( strlen ($val)>0 && preg_match('#^(cfg_|GLOBALS)#',$val) ) { exit('Request var not allow!'); } } }
Replace the above content with the following content:
Copy code
//检查和注册外部提交的变量 function CheckRequest(&$val) { if (is_array($val)) { foreach ($val as $_k=>$_v) { if($_k == 'nvarname') continue ; CheckRequest($_k); CheckRequest($val[$_k]); } } else { if( strlen($val)>0 && preg_match('#^(cfg_|GLOBALS)#',$val) ) { exit('Request var not allow!'); } } }
dedecms template download address: m.sbmmt.com /xiazai/code/dedecms
After modification, save it and then go to the background to try adding new variables.
The above is the detailed content of Analysis of solutions to the error Request var not allow! when adding variables in DedeCMS. For more information, please follow other related articles on the PHP Chinese website!