From 3f2d00ee4f51b1bca603851cc16b751e2e892e7f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 2 Jan 2015 16:52:13 +0100 Subject: [PATCH] Fixed some issues Yes, I'm purposely stripping ' and " from filenames. --- .../install/files/js/3rdParty/redactor/plugins/wbbcode.js | 6 +++--- wcfsetup/install/lang/de.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index dc8f36c635..746593fb87 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -243,7 +243,7 @@ RedactorPlugins.wbbcode = function() { var $uuid = WCF.getUUID(); $cachedCodeListings[$uuid] = { codeContent: codeContent.replace(/
  • /g, '').replace(/<\/li>/g, '\n'), - filename: $filename, + filename: $filename.replace(/['"]/g, ''), highlighter: ($highlighter === 'plain' ? '' : $highlighter), lineNumber: (lineNumber > 1 ? lineNumber : 0) }; @@ -1804,7 +1804,7 @@ RedactorPlugins.wbbcode = function() { var $highlighter = $('#redactorCodeHighlighter'); var $lineNumber = $('#redactorCodeLineNumber'); - var $codeFilename = $.trim($filename.val()); + var $codeFilename = $.trim($filename.val().replace(/['"]/g, '')); var $bbcode = '[code=' + $highlighter.val() + ',' + $lineNumber.val() + ($codeFilename.length ? ",'" + $codeFilename + "'" : '') + ']'; $bbcode += $codeBox.val().replace(/^\n+/, '').replace(/\n+$/, '').replace(/^$/, '\n'); $bbcode += '[/code]'; @@ -1852,7 +1852,7 @@ RedactorPlugins.wbbcode = function() { codeBox.attr('data-highlighter', $selectedHighlighter); var $headline = __REDACTOR_CODE_HIGHLIGHTERS[$selectedHighlighter]; - var $codeFilename = $.trim($filename.val()); + var $codeFilename = $.trim($filename.val().replace(/['"]/g, '')); if ($codeFilename) { $headline += ': ' + WCF.String.escapeHTML($codeFilename); codeBox.data('filename', $codeFilename); diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 5de18a25c4..c9d672dc18 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1771,13 +1771,13 @@ Erlaubte Dateiendungen: {', '|implode:$attachmentHandler->getFormattedAllowedExt - + - + -- 2.20.1