PHP - Plus sign with GET query

后端 未结 6 1463
余生分开走
余生分开走 2020-11-27 20:49

I have a PHP script that does basic encryption of a string through the method below:



        
6条回答
  •  醉梦人生
    2020-11-27 21:08

    If you'll read the entirety of that bug report you'll see a reference to RFC 2396. Which states that + is reserved. PHP is correct in translating an unencoded + sign to a space.

    You could use urlencode() the ciphertext when returning it to the user. Thus, when the user submits the ciphertext for decryption, you can urldecode() it. PHP will do this automatically for you if it comes in via the GET string as well.

    Bottom line: The + must be submitted to PHP as the encoded value: %2B

提交回复
热议问题