From 4b0e7fbfe996ef0b426d49f054c4b357e877f7c3 Mon Sep 17 00:00:00 2001 From: Christophe Massiot Date: Wed, 12 Apr 2006 14:26:21 +0000 Subject: [PATCH] * 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). --- modules/control/http/macro.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/control/http/macro.c b/modules/control/http/macro.c index 7ea5cf193a..0b7bc35ce3 100644 --- a/modules/control/http/macro.c +++ b/modules/control/http/macro.c @@ -301,17 +301,32 @@ void E_(MacroDo)( httpd_file_sys_t *p_args, /* playlist management */ 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; - E_(ExtractURIValue)( p_request, "mrl", mrl, 1024 ); - decode_URI( mrl ); + E_(ExtractURIValue)( p_request, "mrl", tmp, 1024 ); + decode_URI( tmp ); E_(ExtractURIValue)( p_request, "name", psz_name, 1024 ); decode_URI( psz_name ); if( !*psz_name ) { 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 ); if( !p_item || !p_item->input.psz_uri || -- 2.39.2