insert-coin/resources/library/sanitization.php
2018-10-07 03:36:19 -05:00

28 lines
584 B
PHP

<?php
include("../config.php");
// FILENAME --> SAFE_FILENAME_STRING
// Sanitize a filename by replacing common suspicious characters with "_".
function sanitize_filename($filename)
{
$death_characters = array(" ", ",", "/", "\\", "%", "$", "^");
$sanitized_filename = str_replace($death_characters, "_", $filename);
return $sanitized_filename;
}
// IMAGE_PATH --> IMAGE_PATH
// Sanitize an image (EXIF, etc) with external program from config.php
function sanitize_image($path)
{
exec($image_sanitize_command . $image_sanitize_args . $path, $result);
return $path;
}
?>