Commit 5cea088a authored by Christophe Massiot's avatar Christophe Massiot

* modules/access/http.c: Do not use vlc_UrlEncode for the same reason

   than [12145]. We just want to replace spaces.
 * include/network.h: Restored the previous behaviour of vlc_UrlEncode().
   We really mean to URL-encode ? & / etc. in order to be able to pass
   a string containing those special characters as a GET variable in the
   http control interface.
parent 4ff7fb19
......@@ -222,7 +222,7 @@ static inline int isurlsafe( int c )
* (even if they are not URL-safe), nor URL-safe characters.
* We still encode some of them because of Microsoft's crap browser.
*/
|| ( strchr( "/:.[]@&?-_.", c ) != NULL );
|| ( strchr( "-_.", c ) != NULL );
}
/*****************************************************************************
......
......@@ -152,7 +152,7 @@ static int Open( vlc_object_t *p_this )
{
access_t *p_access = (access_t*)p_this;
access_sys_t *p_sys;
char *psz;
char *psz, *p;
/* Set up p_access */
p_access->pf_read = Read;
......@@ -187,21 +187,12 @@ static int Open( vlc_object_t *p_this )
p_sys->psz_icy_title = NULL;
p_sys->i_remaining = 0;
/* Parse URI */
if( vlc_UrlIsNotEncoded( p_access->psz_path ) )
{
psz = vlc_UrlEncode( p_access->psz_path );
if( psz == NULL )
{
free( p_sys );
return VLC_ENOMEM;
}
/* Parse URI - remove spaces */
p = psz = strdup( p_access->psz_path );
while( (p = strchr( p, ' ' )) != NULL )
*p = '+';
vlc_UrlParse( &p_sys->url, psz, 0 );
free( psz );
}
else
vlc_UrlParse( &p_sys->url, p_access->psz_path, 0 );
if( p_sys->url.psz_host == NULL || *p_sys->url.psz_host == '\0' )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment