Update storage.php
This commit is contained in:
parent
e7accfa96a
commit
0561ce9f33
|
@ -47,9 +47,15 @@ if(!check_function_exists("get_storage_dir")) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!check_function_exists("get_safe_path")) {
|
||||||
|
function get_safe_path($path) {
|
||||||
|
return str_replace("../", "", $path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!check_function_exists("get_storage_path")) {
|
if(!check_function_exists("get_storage_path")) {
|
||||||
function get_storage_path($type="data") {
|
function get_storage_path($type="data") {
|
||||||
$dir_path = sprintf("./%s/%s", get_storage_dir(), make_safe_path($type));
|
$dir_path = sprintf("./%s/%s", get_storage_dir(), get_safe_path($type));
|
||||||
|
|
||||||
if(!is_dir($dir_path)) {
|
if(!is_dir($dir_path)) {
|
||||||
if(!@mkdir($dir_path, 0777)) {
|
if(!@mkdir($dir_path, 0777)) {
|
||||||
|
@ -63,7 +69,7 @@ if(!check_function_exists("get_storage_path")) {
|
||||||
|
|
||||||
if(!check_function_exists("get_storage_url")) {
|
if(!check_function_exists("get_storage_url")) {
|
||||||
function get_storage_url($type="data") {
|
function get_storage_url($type="data") {
|
||||||
return sprintf("%s%s/%s", base_url(), get_storage_dir(), make_safe_path($type));
|
return sprintf("%s%s/%s", base_url(), get_storage_dir(), get_safe_path($type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +144,7 @@ if(!check_function_exists("read_storage_file")) {
|
||||||
$storage_type = get_value_in_array("storage_type", $options, "data");
|
$storage_type = get_value_in_array("storage_type", $options, "data");
|
||||||
$upload_base_path = get_storage_path($storage_type);
|
$upload_base_path = get_storage_path($storage_type);
|
||||||
$upload_base_url = get_storage_url($storage_type);
|
$upload_base_url = get_storage_url($storage_type);
|
||||||
$upload_filename = sprintf("%s/%s", $upload_base_path, make_safe_path($filename));
|
$upload_filename = sprintf("%s/%s", $upload_base_path, get_safe_path($filename));
|
||||||
|
|
||||||
if(file_exists($upload_filename)) {
|
if(file_exists($upload_filename)) {
|
||||||
$upload_filesize = filesize($upload_filename);
|
$upload_filesize = filesize($upload_filename);
|
||||||
|
@ -207,7 +213,7 @@ if(!check_function_exists("remove_storage_file")) {
|
||||||
$storage_type = get_value_in_array("storage_type", $options, "data");
|
$storage_type = get_value_in_array("storage_type", $options, "data");
|
||||||
$upload_base_path = get_storage_path($storage_type);
|
$upload_base_path = get_storage_path($storage_type);
|
||||||
$upload_base_url = get_storage_url($storage_type);
|
$upload_base_url = get_storage_url($storage_type);
|
||||||
$upload_filename = sprintf("%s/%s", $upload_base_path, make_safe_path($filename));
|
$upload_filename = sprintf("%s/%s", $upload_base_path, get_safe_path($filename));
|
||||||
|
|
||||||
// add option: encryption
|
// add option: encryption
|
||||||
$encryption = get_value_in_array("encryption", $options, "");
|
$encryption = get_value_in_array("encryption", $options, "");
|
||||||
|
@ -251,9 +257,11 @@ if(!check_function_exists("write_storage_file")) {
|
||||||
$mode = get_value_in_array("mode", $options, "w");
|
$mode = get_value_in_array("mode", $options, "w");
|
||||||
$upload_base_path = get_storage_path($storage_type);
|
$upload_base_path = get_storage_path($storage_type);
|
||||||
$upload_base_url = get_storage_url($storage_type);
|
$upload_base_url = get_storage_url($storage_type);
|
||||||
$upload_filename = sprintf("%s/%s", $upload_base_path, make_safe_path($filename));
|
$upload_filename = sprintf("%s/%s", $upload_base_path, get_safe_path($filename));
|
||||||
|
|
||||||
// add option: encryption
|
// add option: encryption Update config.php 4 minutes ago
|
||||||
|
database.php Update database.php 9 days ago
|
||||||
|
logger.php
|
||||||
$encryption = get_value_in_array("encryption", $options, "");
|
$encryption = get_value_in_array("encryption", $options, "");
|
||||||
if(!empty($encryption)) {
|
if(!empty($encryption)) {
|
||||||
if(!loadHelper("encryptiontool")) {
|
if(!loadHelper("encryptiontool")) {
|
||||||
|
@ -304,7 +312,7 @@ if(!check_function_exists("append_storage_file")) {
|
||||||
|
|
||||||
if(!check_function_exists("get_real_path")) {
|
if(!check_function_exists("get_real_path")) {
|
||||||
function get_real_path($filename) {
|
function get_real_path($filename) {
|
||||||
$filename = make_safe_path($filename);
|
$filename = get_safe_path($filename);
|
||||||
return file_exists($filename) ? realpath($filename) : false;
|
return file_exists($filename) ? realpath($filename) : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user