0

Does Zend Framework hijack the raw $_GET and remove chars? I can't figure out whats going on with a script I am writing.

right now I am passing a variable "email" via a param in the url. Which its working, however. Its stripping out a character and leaving a space.

trying it like $_GET['email'] or like $params = $this->getRequest()->getParams(); $params['email'] on an email string that has a + in it the + gets removed and is replaced with a space. Yet I'm not applying anything that would cause that, that I am aware of anywhere.

So, does anyone else know what the issue may be?

chris
  • 36,115
  • 52
  • 143
  • 252
  • this is a url encoding issue. A raw + sign in a URL will be taken out if not encoded properly. It has nothing to do with Zend. – Brian Driscoll Nov 09 '12 at 20:32

1 Answers1

1

Php does that, see this question: When to encode space to plus (+) or %20?

To get a "+" use %2B in the url

Community
  • 1
  • 1
Niko Sams
  • 4,304
  • 3
  • 25
  • 44
  • ...and to get a real + sign use %2B – Brian Driscoll Nov 09 '12 at 20:34
  • @BrianDriscoll: right, my %20 didn't make sense as + is a space too. I changed it to %2B in the answer. – Niko Sams Nov 09 '12 at 20:37
  • Wow, well.. all these years coding, and I never knew that one. How in the world did I ever manage to get by without hitting this bump before. So this initially steams from the browser down into the server side script as I understand it from that link? Is there anyway to circumvent/suppress that behavior? Cause what I have is a DB that stores these emails that we have, and I can picture someone hand typing it into the URL and landing me in a bit of a spot there. – chris Nov 09 '12 at 20:42
  • I don't think so, that's the way it works. Google for something containing spaces and you'll see the + in the url – Niko Sams Nov 09 '12 at 20:57