I have a parameter that I want to pass to a URL as a GET var. But the
paramater value has a null byte in it. Basically I want to load a URL
like this

http://example.com/test.php?foo=bar%00bar

I tried doing

  var request:URLRequest = new URLRequest('http://example.com/test.php');
  request.data = 'foo=bar%00bar';
  var loader:URLLoader = new URLLoader();
  loader.load(request);

But I get "Error #2032: Stream Error" when i try to load it. If I remove
the null byte (%00) it works fine.

I've also tried using the URLVariables class

  var variables:URLVariables = new URLVariables();
  variables.foo = 'bar' + String.fromCharCode(0) + 'bar';
  request.data = variables;

But that ignores everything after the null byte, and the request ends up
being http://example.com/test.php?foo=bar

I've even tried

  request.data = new URLVariables('foo=bar%00bar');

But that silently removes the null byte, and the request ends up being
http://example.com/test.php?foo=barbar


Is this a bug or am I doing something wrong here?

Thanks

malone

Reply via email to