X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=share%2Fhttp%2Fjs%2Ffunctions.js;h=9dbf7d95e54fcb523667310236d7e6d9d4794f0e;hb=892f3cf9ce0972ff9868e9dfe498bc3d24c55a4e;hp=11ed090b6210d9b34e1c8df96e3447f975186690;hpb=44e5326ddb78f75198c06007de968545797427d9;p=vlc diff --git a/share/http/js/functions.js b/share/http/js/functions.js index 11ed090b62..9dbf7d95e5 100644 --- a/share/http/js/functions.js +++ b/share/http/js/functions.js @@ -235,7 +235,7 @@ function check_and_replace_int( id, val ) } function addslashes( str ){ return str.replace(/\'/g, '\\\''); } -function escapebackslashes( str ){ return str.replace(/\\[^']/g, '\\\\'); } +function escapebackslashes( str ){ return str.replace(/\\/g, '\\\\'); } function toCamelCase( str ) { @@ -656,11 +656,11 @@ function parse_browse_dir( ) setclass( item, 'browser' ); if( elt.getAttribute( 'type' ) == 'directory' ) { - item.setAttribute( 'href', 'javascript:browse_dir(\''+escapebackslashes(addslashes(elt.getAttribute( 'path' )))+'\');'); + item.setAttribute( 'href', 'javascript:browse_dir(\''+addslashes(escapebackslashes(elt.getAttribute( 'path' )))+'\');'); } else { - item.setAttribute( 'href', 'javascript:browse_path(\''+escapebackslashes(addslashes(elt.getAttribute( 'path' )))+'\');' ); + item.setAttribute( 'href', 'javascript:browse_path(\''+addslashes(escapebackslashes(elt.getAttribute( 'path' )))+'\');' ); } item.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) ); pos.appendChild( item ); @@ -669,7 +669,7 @@ function parse_browse_dir( ) pos.appendChild( document.createTextNode( ' ' ) ); var item = document.createElement( "a" ); setclass( item, 'browser' ); - item.setAttribute( 'href', 'javascript:browse_path(\''+escapebackslashes(addslashes(elt.getAttribute( 'path' )))+'\');'); + item.setAttribute( 'href', 'javascript:browse_path(\''+addslashes(escapebackslashes(elt.getAttribute( 'path' )))+'\');'); item.appendChild( document.createTextNode( '(select)' ) ); pos.appendChild( item ); }