Commit 4b0e7fbf authored by Christophe Massiot's avatar Christophe Massiot

* modules/control/http/macro.c: Add slashes in the MVLC_ADD macro for

   backwards compatibility with the old http intf (anyway MVLC_ADD is
   obsoleted by RPN function playlist_add).
parent 92e730c1
...@@ -301,17 +301,32 @@ void E_(MacroDo)( httpd_file_sys_t *p_args, ...@@ -301,17 +301,32 @@ void E_(MacroDo)( httpd_file_sys_t *p_args,
/* playlist management */ /* playlist management */
case MVLC_ADD: case MVLC_ADD:
{ {
char mrl[1024], psz_name[1024]; char mrl[1024], psz_name[1024], tmp[1024];
char *p, *str;
playlist_item_t *p_item; playlist_item_t *p_item;
E_(ExtractURIValue)( p_request, "mrl", mrl, 1024 ); E_(ExtractURIValue)( p_request, "mrl", tmp, 1024 );
decode_URI( mrl ); decode_URI( tmp );
E_(ExtractURIValue)( p_request, "name", psz_name, 1024 ); E_(ExtractURIValue)( p_request, "name", psz_name, 1024 );
decode_URI( psz_name ); decode_URI( psz_name );
if( !*psz_name ) if( !*psz_name )
{ {
memcpy( psz_name, mrl, 1024 ); memcpy( psz_name, mrl, 1024 );
} }
/* addslashes for backward compatibility with the old
* http intf */
p = mrl; str = tmp;
while( *str != '\0' )
{
if( *str == '"' || *str == '\'' || *str == '\\' )
{
*p++ = '\\';
}
*p++ = *str;
str++;
}
*p = '\0';
p_item = E_(MRLParse)( p_intf, mrl, psz_name ); p_item = E_(MRLParse)( p_intf, mrl, psz_name );
if( !p_item || !p_item->input.psz_uri || if( !p_item || !p_item->input.psz_uri ||
......
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