Commit 22067fca by Bagus Pambudi

iframe section post

parent afd11a6d
...@@ -88,7 +88,7 @@ class PostController extends Controller ...@@ -88,7 +88,7 @@ class PostController extends Controller
*/ */
public function store(Request $request) public function store(Request $request)
{ {
$request['content'] = strip_tags($request->content, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']); $request['content'] = strip_tags($request->content, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
$request['title'] = strip_tags($request->title); $request['title'] = strip_tags($request->title);
$request->validate([ $request->validate([
'title' => 'required', 'title' => 'required',
...@@ -223,7 +223,7 @@ class PostController extends Controller ...@@ -223,7 +223,7 @@ class PostController extends Controller
$data['content'] = 'kosong'; $data['content'] = 'kosong';
} }
$content = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th'])); $content = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataEn['post_id'] = $post->id; $dataEn['post_id'] = $post->id;
$dataEn['title'] = $title; $dataEn['title'] = $title;
...@@ -241,7 +241,7 @@ class PostController extends Controller ...@@ -241,7 +241,7 @@ class PostController extends Controller
$data['content'] = 'kosong'; $data['content'] = 'kosong';
} }
$content = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th'])); $content = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataDe['post_id'] = $post->id; $dataDe['post_id'] = $post->id;
$dataDe['title'] = $title; $dataDe['title'] = $title;
...@@ -259,7 +259,7 @@ class PostController extends Controller ...@@ -259,7 +259,7 @@ class PostController extends Controller
$data['content'] = 'kosong'; $data['content'] = 'kosong';
} }
$content = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th'])); $content = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataSa['post_id'] = $post->id; $dataSa['post_id'] = $post->id;
$dataSa['title'] = $title; $dataSa['title'] = $title;
...@@ -277,7 +277,7 @@ class PostController extends Controller ...@@ -277,7 +277,7 @@ class PostController extends Controller
$data['content'] = 'kosong'; $data['content'] = 'kosong';
} }
$content = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th'])); $content = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataZh['post_id'] = $post->id; $dataZh['post_id'] = $post->id;
$dataZh['title'] = $title; $dataZh['title'] = $title;
...@@ -346,11 +346,11 @@ class PostController extends Controller ...@@ -346,11 +346,11 @@ class PostController extends Controller
*/ */
public function update(Request $request, $id) public function update(Request $request, $id)
{ {
$request['content'] = strip_tags($request->content, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']); $request['content'] = strip_tags($request->content, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
$request['content_en'] = strip_tags($request->content_en, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']); $request['content_en'] = strip_tags($request->content_en, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
$request['content_de'] = strip_tags($request->content_de, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']); $request['content_de'] = strip_tags($request->content_de, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
$request['content_sa'] = strip_tags($request->content_sa, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']); $request['content_sa'] = strip_tags($request->content_sa, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
$request['content_zh'] = strip_tags($request->content_zh, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']); $request['content_zh'] = strip_tags($request->content_zh, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
$request['title'] = strip_tags($request->title); $request['title'] = strip_tags($request->title);
$request['title_en'] = strip_tags($request->title_en); $request['title_en'] = strip_tags($request->title_en);
$request['title_de'] = strip_tags($request->title_de); $request['title_de'] = strip_tags($request->title_de);
...@@ -416,7 +416,7 @@ class PostController extends Controller ...@@ -416,7 +416,7 @@ class PostController extends Controller
{ {
if($manual==1){ if($manual==1){
$dataEn['title'] = strip_tags($data['title_en']); $dataEn['title'] = strip_tags($data['title_en']);
$dataEn['content'] = strip_tags($data['content_en'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']); $dataEn['content'] = strip_tags($data['content_en'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
} }
else{ else{
...@@ -426,7 +426,7 @@ class PostController extends Controller ...@@ -426,7 +426,7 @@ class PostController extends Controller
$trans = new GoogleTranslate(); $trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title'])); $title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title']));
$content = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th'])); $content = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataEn['title'] = $title; $dataEn['title'] = $title;
$dataEn['content'] = $content; $dataEn['content'] = $content;
...@@ -438,7 +438,7 @@ class PostController extends Controller ...@@ -438,7 +438,7 @@ class PostController extends Controller
{ {
if($manual==1){ if($manual==1){
$dataDe['title'] = strip_tags($data['title_de']); $dataDe['title'] = strip_tags($data['title_de']);
$dataDe['content'] = strip_tags($data['content_de'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']); $dataDe['content'] = strip_tags($data['content_de'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
} }
else{ else{
...@@ -448,7 +448,7 @@ class PostController extends Controller ...@@ -448,7 +448,7 @@ class PostController extends Controller
$trans = new GoogleTranslate(); $trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title'])); $title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title']));
$content = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th'])); $content = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataDe['title'] = $title; $dataDe['title'] = $title;
$dataDe['content'] = $content; $dataDe['content'] = $content;
} }
...@@ -459,7 +459,7 @@ class PostController extends Controller ...@@ -459,7 +459,7 @@ class PostController extends Controller
{ {
if($manual==1){ if($manual==1){
$dataSa['title'] = strip_tags($data['title_sa']); $dataSa['title'] = strip_tags($data['title_sa']);
$dataSa['content'] = strip_tags($data['content_sa'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']); $dataSa['content'] = strip_tags($data['content_sa'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
} }
else{ else{
...@@ -469,7 +469,7 @@ class PostController extends Controller ...@@ -469,7 +469,7 @@ class PostController extends Controller
$trans = new GoogleTranslate(); $trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title'])); $title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title']));
$content = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th'])); $content = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataSa['title'] = $title; $dataSa['title'] = $title;
$dataSa['content'] = $content; $dataSa['content'] = $content;
} }
...@@ -480,7 +480,7 @@ class PostController extends Controller ...@@ -480,7 +480,7 @@ class PostController extends Controller
{ {
if($manual==1){ if($manual==1){
$dataZh['title'] = strip_tags($data['title_zh']); $dataZh['title'] = strip_tags($data['title_zh']);
$dataZh['content'] = strip_tags($data['content_zh'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th']); $dataZh['content'] = strip_tags($data['content_zh'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']);
} }
else{ else{
if ($data['content'] == null) { if ($data['content'] == null) {
...@@ -489,7 +489,7 @@ class PostController extends Controller ...@@ -489,7 +489,7 @@ class PostController extends Controller
$trans = new GoogleTranslate(); $trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title'])); $title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title']));
$content = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th'])); $content = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'tr', 'td', 'th', 'iframe','section']));
$dataZh['title'] = $title; $dataZh['title'] = $title;
$dataZh['content'] = $content; $dataZh['content'] = $content;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment