Skip to content

Commit

Permalink
Security artikel (#649)
Browse files Browse the repository at this point in the history
* Tambah validasi upload file

* Sesuaikan validasi dengan database

* mutakhirkan catatan rilis

---------

Co-authored-by: sarwono <[email protected]>
  • Loading branch information
yogiperdana and scqolbu24 authored Mar 1, 2023
1 parent 866b97d commit d52075a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/Http/Requests/ArtikelRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ public function authorize()
public function rules()
{
return [
'judul' => 'required',
'judul' => 'required|string|max:191',
'isi' => 'required',
'status' => 'required',
'gambar' => 'nullable|image|mimes:jpg,jpeg,png|max:1024',
];
}
}
7 changes: 4 additions & 3 deletions catatan_rilis.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Terima kasih pada syahransaputra yang baru mulai berkontribusi.

1. [#627](https://github.com/OpenSID/OpenDK/pull/627) Perbaikan eror menu keluarga.
2. [#628](https://github.com/OpenSID/OpenDK/issues/628) Perbaikan eror data demo.
3. [#641](https://github.com/OpenSID/OpenDK/issues/641) Perbaiki sambutan camat kosong
4. [#637](https://github.com/OpenSID/OpenDK/issues/637) Perbaiki preview gambar slider
5. [#639](https://github.com/OpenSID/OpenDK/issues/639) Perbaiki pengisian kolom sejarah.
3. [#641](https://github.com/OpenSID/OpenDK/issues/641) Perbaikan sambutan camat kosong
4. [#637](https://github.com/OpenSID/OpenDK/issues/637) Perbaikan preview gambar slider
5. [#639](https://github.com/OpenSID/OpenDK/issues/639) Perbaikan pengisian kolom sejarah.
6. [#2089](https://github.com/OpenSID/premium/issues/2089) Perbaikan validasi saat unggah gambar di artikel.
4 changes: 2 additions & 2 deletions resources/views/informasi/artikel/_form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<img src="{{ is_img($artikel->gambar ?? null) }}" id="showgambar" style="width:100%; max-height:250px; float:left;"/>

{!! Form::file('gambar', ['placeholder' => 'Gambar', 'class' => 'form-control', 'id' => 'file-artikel']) !!}
{!! Form::file('gambar', ['placeholder' => 'Gambar', 'class' => 'form-control', 'id' => 'file-artikel', 'accept' => 'jpg,jpeg,png']) !!}
@if ($errors->has('gambar')) <span class="help-block" style="color:red">{{ $errors->first('gambar') }}</span> @endif
</div>

Expand All @@ -58,7 +58,7 @@
$('.textarea').wysihtml5();
var fileTypes = ['jpg', 'jpeg', 'png', 'jpg']; //acceptable file types
var fileTypes = ['jpg', 'jpeg', 'png']; //acceptable file types
function readURL(input) {
if (input.files && input.files[0]) {
Expand Down

0 comments on commit d52075a

Please sign in to comment.