X-Git-Url: https://git.p6c8.net/jirafeau_project.git/blobdiff_plain/0d601dd942a8b709adf5812045afcdc5873706c8..53517d3b939f85007001beb3a01a32b032a9070b:/lib/functions.php?ds=sidebyside diff --git a/lib/functions.php b/lib/functions.php index 10e9868..7b63148 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -67,26 +67,26 @@ jirafeau_upload_errstr ($code) { case UPLOAD_ERR_INI_SIZE: case UPLOAD_ERR_FORM_SIZE: - return _('Your file exceeds the maximum authorized file size. '); + return t('Your file exceeds the maximum authorized file size. '); break; case UPLOAD_ERR_PARTIAL: case UPLOAD_ERR_NO_FILE: return - _ + t ('Your file was not uploaded correctly. You may succeed in retrying. '); break; case UPLOAD_ERR_NO_TMP_DIR: case UPLOAD_ERR_CANT_WRITE: case UPLOAD_ERR_EXTENSION: - return _('Internal error. You may not succeed in retrying. '); + return t('Internal error. You may not succeed in retrying. '); break; default: break; } - return _('Unknown error. '); + return t('Unknown error. '); } /** Remove link and it's file @@ -118,9 +118,11 @@ jirafeau_delete ($link) fclose ($handle); } - if ($counter == 0 && file_exists ( VAR_FILES . $md5)) + if ($counter == 0) { - unlink ( VAR_FILES . $md5); + if (file_exists (VAR_FILES . $md5)) + unlink ( VAR_FILES . $md5); + if (file_exists (VAR_FILES . $md5 . '_count')) unlink ( VAR_FILES . $md5. '_count'); } } @@ -136,7 +138,8 @@ jirafeau_delete_file ($md5) foreach ($links_dir as $link) { - if (strcmp ($link, '.') == 0 || strcmp ($link, '..') == 0) + if (strcmp ($link, '.') == 0 || strcmp ($link, '..') == 0 || + preg_match ('/\.tmp/i', "$link")) continue; /* Read link informations. */ $l = jirafeau_get_link ($link); @@ -205,7 +208,7 @@ jirafeau_upload ($file, $one_time_download, $key, $time, $cfg, $ip) return (array( 'error' => array ('has_error' => true, - 'why' => _('Internal error during file creation. ')), + 'why' => t('Internal error during file creation. ')), 'link' =>'', 'delete_link' => '')); } @@ -259,7 +262,7 @@ jirafeau_upload ($file, $one_time_download, $key, $time, $cfg, $ip) return (array( 'error' => array ('has_error' => true, - 'why' => _('Internal error during file creation. ')), + 'why' => t('Internal error during file creation. ')), 'link' =>'', 'delete_link' => '')); } @@ -385,22 +388,23 @@ jirafeau_admin_list ($name, $file_hash, $link_hash) if (!empty ($link_hash)) echo $link_hash . ' '; if (empty ($name) && empty ($file_hash) && empty ($link_hash)) - echo _('List all files'); + echo t('List all files'); echo ''; echo '
' . _('Filename') . ' | '; - echo '' . _('Type') . ' | '; - echo '' . _('Size') . ' | '; - echo '' . _('Expire') . ' | '; - echo '' . _('Onetime') . ' | '; - echo '' . _('Upload date') . ' | '; - echo '' . _('Origin') . ' | '; - echo '' . _('Action') . ' | '; + echo '' . t('Filename') . ' | '; + echo '' . t('Type') . ' | '; + echo '' . t('Size') . ' | '; + echo '' . t('Expire') . ' | '; + echo '' . t('Onetime') . ' | '; + echo '' . t('Upload date') . ' | '; + echo '' . t('Origin') . ' | '; + echo '' . t('Action') . ' | '; echo '