Skip to content

Commit

Permalink
Perbaiki validasi file prosedur (#653)
Browse files Browse the repository at this point in the history
* Perbaiki validasi file prosedur

* mutakhirkan cataatn rilis

---------

Co-authored-by: sarwono <[email protected]>
  • Loading branch information
yogiperdana and scqolbu24 authored Mar 11, 2023
1 parent 5ba51ac commit 3fd1d13
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/Http/Requests/ProsedurRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function rules()
{
return [
'judul_prosedur' => 'required|string|min:5|max:150',
'file_prosedur' => 'file|mimes:jpg,jpeg,png,gif,pdf|max:2048',
'file_prosedur' => 'file|mimes:jpg,jpeg,png,gif,pdf|max:2048|valid_file',
];
}
}
3 changes: 2 additions & 1 deletion catatan_rilis.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Di rilis v23.03.01 berisi perbaikan yang diminta Komunitas OpenDK.
1. [#638](https://github.com/OpenSID/OpenDK/issues/638) Perbaiki slider tidak bisa lebih dari 4.

#### Teknis
1. [#2089](https://github.com/OpenSID/premium/issues/2089) Perbaikan validasi saat unggah gambar di artikel.
1. [#2089](https://github.com/OpenSID/premium/issues/2089) Audit keamanan validasi saat unggah gambar di artikel.
2. [#2114](https://github.com/OpenSID/premium/issues/2114) Audit keamanan form prosedur.
2 changes: 1 addition & 1 deletion resources/views/informasi/prosedur/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<script>
$(function () {
var fileTypes = ['jpg', 'jpeg', 'png', 'jpg', 'bmp', 'pdf']; //acceptable file types
var fileTypes = ['jpg', 'jpeg', 'png', 'bmp', 'pdf']; //acceptable file types
function readURL(input) {
if (input.files && input.files[0]) {
Expand Down
2 changes: 1 addition & 1 deletion resources/views/informasi/prosedur/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<script>
$(function () {
var fileTypes = ['jpg', 'jpeg', 'png', 'jpg', 'bmp', 'pdf']; //acceptable file types
var fileTypes = ['jpg', 'jpeg', 'png', 'bmp', 'pdf']; //acceptable file types
function readURL(input) {
if (input.files && input.files[0]) {
Expand Down
2 changes: 1 addition & 1 deletion resources/views/informasi/prosedur/form_create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="form-group">
<label class="control-label col-md-4 col-sm-3 col-xs-12">File Prosedur <span class="required">*</span></label>
<div class="col-md-5 col-sm-5 col-xs-12">
<input type="file" name="file_prosedur" id="file_prosedur" class="form-control" required >
<input type="file" name="file_prosedur" id="file_prosedur" class="form-control" accept="jpg, jpeg, png, bmp, pdf" required >
<br>

<img class="hide" src="@if(isset($regulasi->file_regulasi)) {{ asset($regulasi->file_regulasi) }} @else {{ "http://placehold.it/1000x600" }} @endif" id="showgambar" style="max-width:400px;max-height:250px;float:left;"/>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/informasi/prosedur/form_edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12">File Prosedur</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="file" name="file_prosedur" id="file_prosedur" class="form-control"/>
<input type="file" name="file_prosedur" id="file_prosedur" class="form-control" accept="jpg, jpeg, png, bmp, pdf"/>
<br/>

@if(isset($prosedur->file_prosedur) && $prosedur->mime_type != 'pdf')
Expand Down

0 comments on commit 3fd1d13

Please sign in to comment.