1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

Miglioramenti vari backup

This commit is contained in:
Thomas Zilio
2019-02-09 14:44:30 +01:00
parent 025d275ec9
commit 13a4ab3cf9
6 changed files with 200 additions and 111 deletions

View File

@@ -72,22 +72,7 @@ function delete($files)
*/
function directory($path)
{
if (is_dir($path) && is_writable($path)) {
return true;
} elseif (!is_dir($path)) {
// Filesystem Symfony
$fs = new Symfony\Component\Filesystem\Filesystem();
// Tentativo di creazione
try {
$fs->mkdir($path);
return true;
} catch (Symfony\Component\Filesystem\Exception\IOException $e) {
}
}
return false;
return Util\FileSystem::directory($path);
}
/**
@@ -410,6 +395,7 @@ function operationLog($operation, array $ids = [], array $options = [])
*
* @return string
*/
function clean($string, $permitted = '') {
return preg_replace('/[^A-Za-z0-9'.$permitted.']/', '', $string); // Removes special chars.
function clean($string, $permitted = '')
{
return preg_replace('/[^A-Za-z0-9'.$permitted.']/', '', $string); // Removes special chars.
}