From:             martin2007 at laposte dot net
Operating system: Linux
PHP version:      5.2.9
PHP Bug Type:     URL related
Bug description:  urlencode and rawurlencode are not RFC-1738 compliant

Description:
------------
urlencode and rawurlencode are not RFC-1738 compliant.

RFC-1738 states:
" Thus, only alphanumerics, the special characters "$-_.+!*'(),", and
reserved characters used for their reserved purposes may be used unencoded
within a URL."
Later on, the grammar is as follows:

unreserved     = alpha | digit | safe | extra
safe           = "$" | "-" | "_" | "." | "+"
extra          = "!" | "*" | "'" | "(" | ")" | ","


However, urlencode and rawurlencode encode $!*'(),

Note that, except for "$" and ",", this is also true for RFC-2396 (URI).

The main problem is that Google uses another encoding scheme. When you
have URLs containing these characters, your weblogs contain several
different URLs for the same resource. It might also confuse some web server
implementations.


See: http://www.monperrus.net/martin/googenc/


Reproduce code:
---------------
echo urlencode("$!*'(),");
echo rawurlencode("$!*'(),");

Expected result:
----------------
$!*'(),
$!*'(),

Actual result:
--------------
%24%21%2A%27%28%29%2C
%24%21%2A%27%28%29%2C

-- 
Edit bug report at http://bugs.php.net/?id=48360&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48360&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48360&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48360&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48360&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48360&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48360&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48360&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48360&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48360&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48360&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48360&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48360&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48360&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48360&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48360&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48360&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48360&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48360&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48360&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48360&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48360&r=mysqlcfg

Reply via email to