Welcome Guest, Not a member yet? Register   Sign In
Disallowed Key Characters. \"url\"
#1

[eluser]pokerking[/eluser]
Hi,

I am posting a request to sever.

http://localhost:81/searchsubmit/page/1

first time i get the result.

When i clicked the button second time

I see this error.

Disallowed Key Characters.

found that disallowed character is this : \"url\"

Now what the hell this is?. It is in POST request keys.

Can someone explain...

Thanks.

======================
The code that checks this is here. Input.php

// Clean $_POST Data
if (is_array($_POST) AND count($_POST) > 0)
{
foreach($_POST as $key => $val)
{
$_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
}
}
========================

function _clean_input_keys($str)
{
if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
{
exit('Disallowed Key Characters:'.$str.':</br>');
}

return $str;
}
#2

[eluser]pokerking[/eluser]
Changed Input.php to debug and print the keys and values of post data

// Clean $_POST Data
if (is_array($_POST) AND count($_POST) > 0)
{
foreach($_POST as $key => $val)
{
echo $key.':'.$val.':</br>';
$_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
}
}

First time

testing :/admin/searchsubmit/page/1personname::combo_organizationid:none:combo_keycontactid:none:combo_trainerid:none:date_start::date_end::

Second time
testing :/admin/searchsubmit/page/1personname::combo_organizationid:none:combo_keycontactid:none:combo_trainerid:none:date_start::date_end::\"url\":\"\"Big Grinisallowed Key Characters:\"url\":
#3

[eluser]pokerking[/eluser]
Ghostly Post Data
Key :\"url\":
Value:\"\"

Anyone seen or had this problem?.

My .htaccess
==========================
# Turn on the Rewrite Engine
Options +FollowSymLinks
RewriteEngine On

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond $1 !^(index\.php|system|img|css|js|video_files|robots\.txt|favicon\.ico) [NC]
RewriteRule ^(.*)$ index.php?/$1 [L]
=================================
$config['uri_protocol'] = "AUTO";
#4

[eluser]pokerking[/eluser]
Remove this whole thread...there was a hidden tag that comes with search result...it has empty value...i still think why it gave me error. anyway i will figure this one out. Can you remove this whole thread.


i was mapping from Post data to form. Bad!. i should have gone from form to post data. In that way i can ignore all the useless hidden fields.

Thanks.
#5

[eluser]louis w[/eluser]
Glad you got it worked out.

One comment about your .htaccess:
Because you have the RewriteCond %{REQUEST_FILENAME} !-f (request is not a real file) you do not need index.php, robots.txt, and favicon.ico in your other RewriteCond. This should let you clean it up a bit so you do not have to keep managing this list of exceptions.




Theme © iAndrew 2016 - Forum software by © MyBB