mirror of
https://github.com/itflow-org/itflow
synced 2026-03-06 13:54:51 +00:00
Only accept jpg, jpeg and png for company logo
This commit is contained in:
@@ -48,7 +48,7 @@ $company_initials = nullable_htmlentities(initials($company_name));
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file" accept=".jpg, .jpeg, .png">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -20,10 +20,9 @@ if (isset($_POST['edit_company'])) {
|
|||||||
|
|
||||||
// Check to see if a file is attached
|
// Check to see if a file is attached
|
||||||
if ($_FILES['file']['tmp_name'] != '') {
|
if ($_FILES['file']['tmp_name'] != '') {
|
||||||
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png'))) {
|
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'png'))) {
|
||||||
$file_tmp_path = $_FILES['file']['tmp_name'];
|
$file_tmp_path = $_FILES['file']['tmp_name'];
|
||||||
|
|
||||||
|
|
||||||
// directory in which the uploaded file will be moved
|
// directory in which the uploaded file will be moved
|
||||||
$upload_file_dir = "uploads/settings/";
|
$upload_file_dir = "uploads/settings/";
|
||||||
$dest_path = $upload_file_dir . $new_file_name;
|
$dest_path = $upload_file_dir . $new_file_name;
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ if (isset($_POST['add_company_settings'])) {
|
|||||||
$new_file_name = md5(time() . $file_name) . '.' . $file_extension;
|
$new_file_name = md5(time() . $file_name) . '.' . $file_extension;
|
||||||
|
|
||||||
// check if file has one of the following extensions
|
// check if file has one of the following extensions
|
||||||
$allowed_file_extensions = array('jpg', 'gif', 'png');
|
$allowed_file_extensions = array('jpg', 'jpeg', 'png');
|
||||||
|
|
||||||
if (in_array($file_extension,$allowed_file_extensions) === false) {
|
if (in_array($file_extension,$allowed_file_extensions) === false) {
|
||||||
$file_error = 1;
|
$file_error = 1;
|
||||||
@@ -975,7 +975,7 @@ if (isset($_POST['add_telemetry'])) {
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Logo</label>
|
<label>Logo</label>
|
||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file" accept=".jpg, .jpeg, .png">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
Reference in New Issue
Block a user