Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
couple bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
martin committed Aug 31, 2016
1 parent 8bd5c73 commit 95d3ec6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ajaxsupplement.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
$new_name = preg_replace('/[^a-zA-Z0-9\-\_\.]/', '_', $new_name);
$new_name = sprintf("%05d", intval($_POST['file'])) . $new_name;

move_uploaded_file($_FILES['form_supplementary_file']['tmp_name'][$i], IL_SUPPLEMENT_PATH . DIRECTORY_SEPARATOR . get_subfolder($new_name) . DIRECTORY_SEPARATOR . $new_name);
move_uploaded_file($_FILES['form_supplementary_file']['tmp_name'][$i], IL_SUPPLEMENT_PATH . DIRECTORY_SEPARATOR . get_subfolder($new_name, IL_SUPPLEMENT_PATH) . DIRECTORY_SEPARATOR . $new_name);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
if (!is_dir(IL_USER_DATABASE_PATH)) {
@mkdir(IL_USER_DATABASE_PATH, 0755);
}
if (!is_dir(IL_SUPPLEMENT_PATH . DIRECTORY_SEPARATOR . '01')) {
@mkdir(IL_SUPPLEMENT_PATH . DIRECTORY_SEPARATOR . '01', 0755, true);
if (!is_dir(IL_SUPPLEMENT_PATH . DIRECTORY_SEPARATOR . '0' . DIRECTORY_SEPARATOR . '0')) {
@mkdir(IL_SUPPLEMENT_PATH . DIRECTORY_SEPARATOR . '0' . DIRECTORY_SEPARATOR . '0', 0755, true);
}
if (!is_dir(IL_IMAGE_PATH)) {
@mkdir(IL_IMAGE_PATH, 0755, true);
}
if (!is_dir(IL_PDF_PATH . DIRECTORY_SEPARATOR . '01')) {
@mkdir(IL_PDF_PATH . DIRECTORY_SEPARATOR . '01', 0755, true);
if (!is_dir(IL_PDF_PATH . DIRECTORY_SEPARATOR . '0' . DIRECTORY_SEPARATOR . '0')) {
@mkdir(IL_PDF_PATH . DIRECTORY_SEPARATOR . '0' . DIRECTORY_SEPARATOR . '0', 0755, true);
}
if (!is_dir(IL_PDF_CACHE_PATH)) {
@mkdir(IL_PDF_CACHE_PATH, 0755, true);
Expand Down
4 changes: 2 additions & 2 deletions upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ function trim_value(&$value) {

if (stripos($contents, '%PDF') === 0) {

$move = file_put_contents(IL_PDF_PATH . DIRECTORY_SEPARATOR . get_subfolder($new_file) . DIRECTORY_SEPARATOR . $new_file, $contents);
$move = file_put_contents(IL_PDF_PATH . DIRECTORY_SEPARATOR . get_subfolder($new_file, IL_PDF_PATH) . DIRECTORY_SEPARATOR . $new_file, $contents);

if ($move == false) {

Expand Down Expand Up @@ -499,7 +499,7 @@ function trim_value(&$value) {
$supplement_filename = preg_replace('/[^a-zA-Z0-9\-\_\.]/', '_', $supplement_filename);
$supplement_filename = sprintf("%05d", $new_file) . $supplement_filename;

$move = move_uploaded_file($_FILES['form_supplementary_file']['tmp_name'][$i], IL_SUPPLEMENT_PATH . DIRECTORY_SEPARATOR . get_subfolder($new_file) . DIRECTORY_SEPARATOR . $supplement_filename);
$move = move_uploaded_file($_FILES['form_supplementary_file']['tmp_name'][$i], IL_SUPPLEMENT_PATH . DIRECTORY_SEPARATOR . get_subfolder($new_file, IL_SUPPLEMENT_PATH) . DIRECTORY_SEPARATOR . $supplement_filename);
if ($move == false)
$error[] = "Error! The supplementary file " . $_FILES['form_supplementary_file']['name'][$i] . " has not been recorded.";
if ($move == true)
Expand Down

0 comments on commit 95d3ec6

Please sign in to comment.