The error Requestvarnotallow is reported when the variable is added to DedeCMS! Solution example analysis

Source: Internet
Author: User
This article describes how to add variable error Requestvarnotallow in DedeCMS! This article provides a method to modify the php file, but it cannot be solved, for more information about how to add a variable in DedeCMS, see the following article: Request var not allow! This article provides a method to modify the php file, but it cannot be solved, if you want to add a new variable in the background, you can refer to the forum where many people have reported that "Request var not allow! "BUG error. This article mainly describes how to solve this problem! The following describes 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:

// Check and register the variable function CheckRequest (& $ val) submitted externally {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 preceding content with the following:

// Check and register the variable function CheckRequest (& $ val) submitted externally {if (is_array ($ val) {foreach ($ val as $ _ k => $ _ v) {if ($ _ k = 'varname') continue; CheckRequest ($ _ k); CheckRequest ($ val [$ _ k]);} else {if (strlen ($ val)> 0 & preg_match ('# ^ (cfg _ | GLOBALS) #', $ val) {exit ('request var not allow! ');}}}

Dedecms Template: www.php1.cn/xiazai/code/dedecms

Save the changes and try to add new variables in the background.

The preceding error is returned when the variable "Request var not allow" is added to DedeCMS! Solution details of the instance analysis, please pay attention to other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.