Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439 Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
16 lines
729 B
PHP
16 lines
729 B
PHP
<?php
|
|
// You must first create a file "savefile_config.php" in this extensions directory and do whatever
|
|
// checking of user credentials, etc. that you wish; otherwise anyone will be able to post SVG
|
|
// files to your server which may cause disk space or possibly security problems
|
|
require 'savefile_config.php';
|
|
if (!isset($_POST['output_svg'])) {
|
|
print "You must supply output_svg";
|
|
exit;
|
|
}
|
|
$svg = $_POST['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);
|