This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | /* |
||
2 | * Copyright (c) 2016 |
||
3 | * |
||
4 | * This file is licensed under the Affero General Public License version 3 |
||
5 | * or later. |
||
6 | * |
||
7 | * See the COPYING-README file. |
||
8 | * |
||
9 | */ |
||
10 | |||
11 | import {getSyntaxMode} from "./SyntaxMode"; |
||
0 ignored issues
–
show
|
|||
12 | import importAce from './ImportAce'; |
||
0 ignored issues
–
show
'import' is only available in ES6 (use 'esversion: 6').
Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code. Further Reading: ![]() |
|||
13 | |||
14 | /** @type array[] supportedMimeTypes */ |
||
15 | const supportedMimeTypes = require('./supported_mimetypes.json'); |
||
0 ignored issues
–
show
|
|||
16 | |||
17 | export class SidebarPreview { |
||
0 ignored issues
–
show
'export' is only available in ES6 (use 'esversion: 6').
Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code. Further Reading: ![]() |
|||
18 | attach (manager) { |
||
19 | const handler = this.handlePreview.bind(this); |
||
0 ignored issues
–
show
|
|||
20 | supportedMimeTypes.forEach(value => manager.addPreviewHandler(value, handler)); |
||
0 ignored issues
–
show
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code. Further Reading: ![]() |
|||
21 | } |
||
22 | |||
23 | handlePreview (model, $thumbnailDiv, $thumbnailContainer, fallback) { |
||
24 | const previewWidth = $thumbnailContainer.parent().width() + 50; // 50px for negative margins |
||
0 ignored issues
–
show
|
|||
25 | const previewHeight = previewWidth / (16 / 9); |
||
0 ignored issues
–
show
|
|||
26 | |||
27 | this.getFileContent(model.getFullPath()).then(function (content) { |
||
28 | content = content.filecontents; |
||
29 | $thumbnailDiv.removeClass('icon-loading icon-32'); |
||
30 | $thumbnailContainer.addClass('large'); |
||
31 | $thumbnailContainer.addClass('text'); |
||
32 | const $editorDiv = $("<div id='sidebar_editor'/>"); |
||
0 ignored issues
–
show
|
|||
33 | $editorDiv.text(content); |
||
34 | $thumbnailDiv.children('.stretcher').remove(); |
||
35 | $thumbnailDiv.append($editorDiv); |
||
36 | importAce().then((imports) => { |
||
0 ignored issues
–
show
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code. Further Reading: ![]() |
|||
37 | const editor = imports.edit('sidebar_editor'); |
||
0 ignored issues
–
show
|
|||
38 | editor.setReadOnly(true); |
||
39 | let syntaxModePromise; |
||
0 ignored issues
–
show
|
|||
40 | if (model.get('mimetype') === 'text/html') { |
||
41 | syntaxModePromise = getSyntaxMode('html'); |
||
42 | } else { |
||
43 | // Set the syntax mode based on the file extension |
||
44 | syntaxModePromise = getSyntaxMode( |
||
45 | model.get('name').split('.')[model.get('name').split('.').length - 1] |
||
46 | ); |
||
47 | } |
||
48 | syntaxModePromise.then(function (mode) { |
||
49 | if (mode) { |
||
50 | editor.getSession().setMode(`ace/mode/${mode}`); |
||
0 ignored issues
–
show
'template literal syntax' is only available in ES6 (use 'esversion: 6').
Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code. Further Reading: ![]() |
|||
51 | } |
||
52 | }); |
||
53 | // Set the theme |
||
54 | import('brace/theme/clouds').then(() => { |
||
0 ignored issues
–
show
'import' is only available in ES6 (use 'esversion: 6').
Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code. Further Reading: ![]() 'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code. Further Reading: ![]() |
|||
55 | editor.setTheme("ace/theme/clouds"); |
||
56 | }); |
||
57 | $editorDiv.css("height", previewHeight); |
||
58 | $editorDiv.css("width", previewWidth); |
||
59 | }); |
||
60 | }, function () { |
||
61 | fallback(); |
||
62 | }); |
||
63 | } |
||
64 | |||
65 | getFileContent (path) { |
||
66 | const parts = path.split('/'); |
||
0 ignored issues
–
show
|
|||
67 | const dir = parts.slice(0, -1).join(''); |
||
0 ignored issues
–
show
|
|||
68 | const file = parts.slice(-1).join(''); |
||
0 ignored issues
–
show
|
|||
69 | |||
70 | return $.ajax({ |
||
71 | url: OC.generateUrl('/apps/files_texteditor/ajax/loadfile'), |
||
72 | data: { |
||
73 | filename: file, |
||
74 | dir: dir |
||
75 | }, |
||
76 | headers: { |
||
77 | 'Range': 'bytes=0-10240' |
||
78 | } |
||
79 | }); |
||
80 | } |
||
81 | } |
||
82 |
Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code.
Further Reading: