mact var for using in forms

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Lucas
New Member
New Member
Posts: 7
Joined: Mon Nov 26, 2007 12:31 pm
Location: Netherlands

mact var for using in forms

Post by Lucas »

Hello, I noticed that some modules are using the mact var in forms as a hidden field. However, when a form is posted to /admin/moduleinterface.php in this way, the mact var is not behaving as I would expect.
This shows in the breadcrumb and module title not visible in the module.

The cause for this is the var `query` in class.admintheme.inc.php is not urldecoded. This is necessary because POST vars are automatticaly urlencoded.

Simple solution is to change line 121 of this file to:

Code: Select all

$this->query = (isset($_SERVER['QUERY_STRING'])?urldecode($_SERVER['QUERY_STRING']):'');
Do you guys foresee any problems?
Last edited by Lucas on Fri Feb 01, 2008 3:52 pm, edited 1 time in total.
Lucas
New Member
New Member
Posts: 7
Joined: Mon Nov 26, 2007 12:31 pm
Location: Netherlands

Re: mact var for using in forms

Post by Lucas »

I'm not sure why the above solution ever worked  ;D

I changed the line to:

Code: Select all

$this->query = (isset($_REQUEST['mact'])? 'mact=' . $_REQUEST['mact']:'');
I don't see this as a bugfix, but more as a `hack`... any comments?
Post Reply

Return to “Developers Discussion”