Avoid URL decoding; remove dead code; add encoding to XML Declaration in php_savefile extension

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2663 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Brett Zamir
2014-02-01 16:42:46 +00:00
parent 21c946fd99
commit 0e9a7a7766
2 changed files with 5 additions and 10 deletions

View File

@@ -8,10 +8,9 @@
exit;
}
$svg = $_POST['output_svg'];
$filename = (isset($_POST['filename']) && !empty($_POST['filename']) ? preg_replace('@[\\\\/:*?"<>|]@', '_', urldecode($_POST['filename'])) : 'saved') . '.svg'; // These characters are indicated as prohibited by Windows
$output_svg = urldecode($svg);
$file = $filename;
$fh = fopen($file, 'w') or die("Can't open file");
fwrite($fh, $output_svg);
$filename = (isset($_POST['filename']) && !empty($_POST['filename']) ? preg_replace('@[\\\\/:*?"<>|]@u', '_', $_POST['filename']) : 'saved') . '.svg'; // These characters are indicated as prohibited by Windows
$fh = fopen($filename, 'w') or die("Can't open file");
fwrite($fh, $svg);
fclose($fh);
?>