diff --git a/codepot/src/codepot/controllers/file.php b/codepot/src/codepot/controllers/file.php index 07dc58eb..effe9374 100644 --- a/codepot/src/codepot/controllers/file.php +++ b/codepot/src/codepot/controllers/file.php @@ -157,7 +157,7 @@ class File extends Controller redirect ("main/signin/" . $this->converter->AsciiTohex(current_url())); } - $file = $this->files->fetch_file ($login['id'], $project, $name); + $file = $this->files->fetchFile ($login['id'], $project, $name); if ($file === FALSE) { $data['project'] = $project; @@ -612,10 +612,11 @@ class File extends Controller break; } - if (strpos($_FILES[$fid]['name'], ':') !== FALSE) + if (strpos($_FILES[$fid]['name'], ':') !== FALSE || + strpos($_FILES[$fid]['name'], '/') !== FALSE) { /* for wiki */ - $status = "error - colon not allowed - {$_FILES[$fid]['name']}"; + $status = "error - colon or slash not allowed - {$_FILES[$fid]['name']}"; break; } diff --git a/codepot/src/codepot/models/filemodel.php b/codepot/src/codepot/models/filemodel.php index e3b6ad22..79a4e650 100644 --- a/codepot/src/codepot/models/filemodel.php +++ b/codepot/src/codepot/models/filemodel.php @@ -56,7 +56,7 @@ class FileModel extends Model return $file; } - function fetch_file ($userid, $project, $name) + function fetchFile ($userid, $project, $name) { $this->db->trans_start (); $this->db->where ('projectid', $project->id); diff --git a/codepot/src/codepot/views/file_home.php b/codepot/src/codepot/views/file_home.php index 26a6025b..cb999db2 100644 --- a/codepot/src/codepot/views/file_home.php +++ b/codepot/src/codepot/views/file_home.php @@ -260,7 +260,11 @@ $this->load->view (
lang->line('Files')?>
- lang->line('FILE_FMT_TOTAL_X_FILES'), count($files)); ?> + file_list); + printf ($this->lang->line('FILE_FMT_TOTAL_X_FILES'), $total_file_count); + ?> |