]> source.dussan.org Git - nextcloud-server.git/commitdiff
prevent xss attacks by manipulating text file names
authorBjoern Schiessle <schiessle@owncloud.com>
Mon, 4 Jun 2012 14:20:03 +0000 (16:20 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Mon, 4 Jun 2012 14:20:03 +0000 (16:20 +0200)
apps/files_texteditor/js/editor.js

index 9d168c1c4f6cf13d30da5dc08113b87f99bb2060..70bb74a91013cc3ad4f154b9faa0c3f3c3d0c033 100644 (file)
@@ -67,7 +67,7 @@ function setSyntaxMode(ext){
 function showControls(filename,writeperms){
        // Loads the control bar at the top.
        // Load the new toolbar.
-       var editorbarhtml = '<div id="editorcontrols" style="display: none;"><div class="crumb svg last" id="breadcrumb_file" style="background-image:url(&quot;'+OC.imagePath('core','breadcrumb.png')+'&quot;)"><p>'+filename+'</p></div>';
+       var editorbarhtml = '<div id="editorcontrols" style="display: none;"><div class="crumb svg last" id="breadcrumb_file" style="background-image:url(&quot;'+OC.imagePath('core','breadcrumb.png')+'&quot;)"><p>'+filename.replace(/</, "&lt;").replace(/>/, "&gt;")+'</p></div>';
        if(writeperms=="true"){
                editorbarhtml += '<button id="editor_save">'+t('files_texteditor','Save')+'</button><div class="separator"></div>';
        }