diff options
author | Florian Hülsmann <fh@cbix.de> | 2012-05-11 00:36:17 +0400 |
---|---|---|
committer | Florian Hülsmann <fh@cbix.de> | 2012-05-11 00:36:17 +0400 |
commit | 7073f873b817ba10df5c6b89c0744ad5519dc865 (patch) | |
tree | c05c13259a57109e0a7f8c807864ee00c07e4270 /files_svgedit | |
parent | 7d239a754efcb1d43ac47831b91eec6385176248 (diff) |
merged files_svgedit 0.2-beta6 from official repo
Diffstat (limited to 'files_svgedit')
-rw-r--r-- | files_svgedit/RELEASE | 5 | ||||
-rw-r--r-- | files_svgedit/ROADMAP | 6 | ||||
-rw-r--r-- | files_svgedit/ajax/save.php | 6 | ||||
-rw-r--r-- | files_svgedit/appinfo/info.xml | 2 | ||||
-rw-r--r-- | files_svgedit/js/ocsvgEditor.js | 8 | ||||
-rw-r--r-- | files_svgedit/svg-edit/extensions/fileopen.php | 31 | ||||
-rw-r--r-- | files_svgedit/svg-edit/extensions/filesave.php | 44 | ||||
-rw-r--r-- | files_svgedit/templates/editor.php | 1 |
8 files changed, 23 insertions, 80 deletions
diff --git a/files_svgedit/RELEASE b/files_svgedit/RELEASE index 8c74b6a3d..e49a121ec 100644 --- a/files_svgedit/RELEASE +++ b/files_svgedit/RELEASE @@ -3,6 +3,11 @@ Copyright (c) 2012 Florian Hülsmann <fh@cbix.de> Here you find change log and release notes! +2012/05/10 - beta6/0.2 + * important security fix + * print button + * workaround for magic_quotes_gpc + 2012/04/19 - beta5/0.2 * using a better maintained fork of jsPDF by willowsystems * changing possibly irritating error messages on saving diff --git a/files_svgedit/ROADMAP b/files_svgedit/ROADMAP index 9f2ed29e6..317174297 100644 --- a/files_svgedit/ROADMAP +++ b/files_svgedit/ROADMAP @@ -1,16 +1,16 @@ -Planned features for ocsvg (SVG editor for ownCloud) as of 0.2-beta5 +Planned features for ocsvg (SVG editor for ownCloud) as of 0.2-beta6 beta: * more saving options (PDF meta information, ...) * multiple PDF pages (e.g. split by layer, render single pages) * include images into exported PDF (if possible with jsPDF) - * printing button (like the files_pdfview app) * better integration of svg-edit features (doc properties etc.) + * support for ownCloud 4 (if not downwards compatible, make it a seperate app) 1.0: * file picker dialogs for image/svg import and saving * l10n (set svg-edit language to the current owncloud language) Ideas for the future: - * collaborative editing + * collaborative editing (e.g. with input field for etherpad lite pad URL) * PDF export of more element types (paths, gradients, arrows etc. if possible) diff --git a/files_svgedit/ajax/save.php b/files_svgedit/ajax/save.php index 0a0f19e52..38a927ee4 100644 --- a/files_svgedit/ajax/save.php +++ b/files_svgedit/ajax/save.php @@ -11,13 +11,17 @@ require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); // Get paramteres -$filecontents = htmlspecialchars_decode($_POST['file']['filecontents']); +$filecontents = $_POST['file']['filecontents']; $path = isset($_POST['file']['path']) ? $_POST['file']['path'] : ''; $mtime = isset($_POST['file']['mtime']) ? $_POST['file']['mtime'] : ''; $force = isset($_POST['force']) ? ($_POST['force'] == 'true') : false; $b64encoded = isset($_POST['base64encoded']) ? ($_POST['base64encoded'] == 'true') : false; if($b64encoded) { $b64type = isset($_POST['base64type']) ? $_POST['base64type'] : 'image/png'; +} else { + if(get_magic_quotes_gpc()) { + $filecontents = stripslashes($filecontents); + } } $pathParts = pathinfo($path); diff --git a/files_svgedit/appinfo/info.xml b/files_svgedit/appinfo/info.xml index f48148f33..f3f8b0542 100644 --- a/files_svgedit/appinfo/info.xml +++ b/files_svgedit/appinfo/info.xml @@ -3,7 +3,7 @@ <id>files_svgedit</id> <name>SVG Editor</name> <description>Create and modify vector graphics, export them to PNG (canvg-powered) or PDF (with help of jsPDF, only basic shapes and text). Based on svg-edit 2.6 (http://svg-edit.googlecode.com).</description> - <version>0.2-beta5</version> + <version>0.2-beta6</version> <licence>LGPLv3</licence> <author>Florian Hülsmann</author> <require>2</require> diff --git a/files_svgedit/js/ocsvgEditor.js b/files_svgedit/js/ocsvgEditor.js index 9f5b8357d..40cfcbac7 100644 --- a/files_svgedit/js/ocsvgEditor.js +++ b/files_svgedit/js/ocsvgEditor.js @@ -125,6 +125,14 @@ $(document).ready(function() { $('#ocsvgBtnSave').click(function() { $('#svgEditorSave').dialog('open'); }); + $('#ocsvgBtnPrint').click(function() { + svgCanvas.getSvgString()(function(svg, error) { + var printWin = window.open(); + printWin.document.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n' + svg); + printWin.print(); + printWin.close(); + }); + }); $('#svgSaveBtn').click(function() { svgCanvas.getSvgString()(function(svg, error) { var btn = $('#svgSaveBtn'); diff --git a/files_svgedit/svg-edit/extensions/fileopen.php b/files_svgedit/svg-edit/extensions/fileopen.php deleted file mode 100644 index a6661e5cd..000000000 --- a/files_svgedit/svg-edit/extensions/fileopen.php +++ /dev/null @@ -1,31 +0,0 @@ -<!doctype html> -<?php -/* - * fileopen.php - * To be used with ext-server_opensave.js for SVG-edit - * - * Licensed under the Apache License, Version 2 - * - * Copyright(c) 2010 Alexis Deveria - * - */ - // Very minimal PHP file, all we do is Base64 encode the uploaded file and - // return it to the editor - - $file = $_FILES['svg_file']['tmp_name']; - - $output = file_get_contents($file); - - $type = $_REQUEST['type']; - - $prefix = ''; - - // Make Data URL prefix for import image - if($type == 'import_img') { - $info = getimagesize($file); - $prefix = 'data:' . $info['mime'] . ';base64,'; - } -?> -<script> -window.top.window.svgEditor.processFile("<?php echo $prefix . base64_encode($output); ?>", "<?php echo $type ?>"); -</script>
\ No newline at end of file diff --git a/files_svgedit/svg-edit/extensions/filesave.php b/files_svgedit/svg-edit/extensions/filesave.php deleted file mode 100644 index 77414b807..000000000 --- a/files_svgedit/svg-edit/extensions/filesave.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/* - * filesave.php - * To be used with ext-server_opensave.js for SVG-edit - * - * Licensed under the Apache License, Version 2 - * - * Copyright(c) 2010 Alexis Deveria - * - */ - -if(!isset($_POST['output_svg']) && !isset($_POST['output_png'])) { - die('post fail'); -} - -$file = ''; - -$suffix = isset($_POST['output_svg'])?'.svg':'.png'; - -if(isset($_POST['filename']) && strlen($_POST['filename']) > 0) { - $file = $_POST['filename'] . $suffix; -} else { - $file = 'image' . $suffix; -} - -if($suffix == '.svg') { - $mime = 'image/svg+xml'; - $contents = rawurldecode($_POST['output_svg']); -} else { - $mime = 'image/png'; - $contents = $_POST['output_png']; - $pos = (strpos($contents, 'base64,') + 7); - $contents = base64_decode(substr($contents, $pos)); -} - - header("Cache-Control: public"); - header("Content-Description: File Transfer"); - header("Content-Disposition: attachment; filename=" . $file); - header("Content-Type: " . $mime); - header("Content-Transfer-Encoding: binary"); - - echo $contents; - -?>
\ No newline at end of file diff --git a/files_svgedit/templates/editor.php b/files_svgedit/templates/editor.php index 90f7e0db0..7dd7a6d58 100644 --- a/files_svgedit/templates/editor.php +++ b/files_svgedit/templates/editor.php @@ -11,6 +11,7 @@ var ocsvgFile = { <input type="button" id="ocsvgBtnSave" value="<?php echo $l->t('Save'); ?>" /> <input type="button" id="ocsvgBtnProps" value="<?php echo $l->t('Properties'); ?>" /> <input type="button" id="ocsvgBtnPrefs" value="<?php echo $l->t('Preferences'); ?>" /> + <input type="button" id="ocsvgBtnPrint" value="<?php echo $l->t('Print'); ?>" /> <div class="separator"></div> <input type="button" id="ocsvgBtnClose" value="<?php echo $l->t('Close'); ?>" /> </div> |