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:
@@ -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.
|
||||
}
|
||||
|
Reference in New Issue
Block a user