Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8502753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:34:23+00:00 2026-06-11T01:34:23+00:00

I am passing a query string as part of my query string to a

  • 0

I am passing a query string as part of my query string to a PHP script.

Kinda like this:

$.post('/url', {
    id: postID
    filters: $('#form').serialize()
});

Then in my PHP, I use parse_str to read filters:

<?php
$postID = $this->input->post('id');
parse_str($this->input->post('filters'), $filters);

The problem is that parse_str is adding ;s randomly to the keys. I’m getting a result like this:

array(4) {
  ["users"]=>
  string(0) ""
  ["companies;"]=>
  string(0) ""
  ["pref;_123"]=>
  string(0) ""
  ["products;"]=>
  array(2) {
    [0]=>
    string(4) "1234"
    [1]=>
    string(4) "5678"
  }
}

Why is the server adding ;? I tried it on another server, and this doesn’t happen. It also doesn’t happen when testing via CLI.

EDIT: Seems this is not parse_str‘s fault, but some sort of XSS filter. $this->input->post('filters') (and even $_POST['filters']!) contains the ; characters. I checked, and jQuery is not adding them.

EDIT: I managed to “fix” this by doing:

$filters = array_combine(array_map(function($x){
    return str_replace(';', '', $x);
}, array_keys($filters)), array_values($filters));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:34:25+00:00Added an answer on June 11, 2026 at 1:34 am

    This is caused by the config variable global_xss_filtering in Codeigniter. Set it to false to disable this behaviour.

    See also:
    xss_clean adds semicolon to anything with an &
    CodeIgniter adding semicolons

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi everyone currently i am passing query string in my url like ip:port/contextroot/page.jsf?id=22&tsid=1234 the
This phpinfo() demonstrates the problem. I'm passing the URL a query string of: ?qwerty=asdfg
I am passing query string and the url is as follows-> http://localhost:1086/Web/EditMobile.aspx?sno=2 . But
I'm passing query string parameter to .aspx page with 'Ñ' character in value. But
Hi I am having an issue with a MySQL query not passing a string
I have form1 passing a query string parameter(param1) to form2. I pass param1=true from
Is there a standard way of passing an array through a query string? To
I have a class that builds a url with query string parameters and so
I am passing two variables in from a query string (which I verified that
I am passing a query string to my account controller from a external source

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.