Commit df8da81d by Siti Aisah

remove allowed tags for title

parent 2bba3b15
......@@ -80,7 +80,7 @@ class AgendaController extends Controller
public function store(Request $request)
{
$request['content'] = strip_tags($request->content, ['a', 'br', 'p', 'b', 'i', 'u', 'tr', 'th', 'td', 'ul', 'li', 'ol', 'img']);
$request['title'] = strip_tags($request->title, ['b', 'i', 'u']);
$request['title'] = strip_tags($request->title);
$request->validate([
'title' => 'required',
'content' => 'required|min:3',
......@@ -119,9 +119,9 @@ class AgendaController extends Controller
private function createEn($data, $agenda)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title']));
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
......@@ -137,9 +137,9 @@ class AgendaController extends Controller
private function createDe($data, $agenda)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title']));
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
......@@ -155,9 +155,9 @@ class AgendaController extends Controller
private function createSa($data, $agenda)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title']));
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
......@@ -173,9 +173,9 @@ class AgendaController extends Controller
private function createZh($data, $agenda)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title']));
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
......@@ -254,11 +254,11 @@ class AgendaController extends Controller
$request['content_de'] = strip_tags($request->content_de, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['content_sa'] = strip_tags($request->content_sa, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['content_zh'] = strip_tags($request->content_zh, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['title'] = strip_tags($request->title, ['b', 'i', 'u']);
$request['title_en'] = strip_tags($request->title_en, ['b', 'i', 'u']);
$request['title_de'] = strip_tags($request->title_de, ['b', 'i', 'u']);
$request['title_sa'] = strip_tags($request->title_sa, ['b', 'i', 'u']);
$request['title_zh'] = strip_tags($request->title_zh, ['b', 'i', 'u']);
$request['title'] = strip_tags($request->title);
$request['title_en'] = strip_tags($request->title_en);
$request['title_de'] = strip_tags($request->title_de);
$request['title_sa'] = strip_tags($request->title_sa);
$request['title_zh'] = strip_tags($request->title_zh);
$request->validate([
// 'title' => 'required',
......@@ -314,12 +314,12 @@ class AgendaController extends Controller
$dataEn['content'] = $data['content_en'];
}
else{
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataEn['title'] = $title;
......@@ -337,12 +337,12 @@ class AgendaController extends Controller
}
else{
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataDe['title'] = $title;
$dataDe['content'] = $content;
......@@ -359,12 +359,12 @@ class AgendaController extends Controller
}
else{
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataSa['title'] = $title;
......@@ -382,12 +382,12 @@ class AgendaController extends Controller
}
else{
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataZh['title'] = $title;
......
......@@ -80,7 +80,7 @@ class InformationController extends Controller
public function store(Request $request)
{
$request['content'] = strip_tags($request->content, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['title'] = strip_tags($request->title, ['b', 'i', 'u']);
$request['title'] = strip_tags($request->title);
$request->validate([
'title' => 'required',
'content' => 'required|min:3',
......@@ -119,7 +119,7 @@ class InformationController extends Controller
private function createEn($data, $information)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title']));
if ($data['content'] == null) {
$data['content'] = 'kosong';
......@@ -137,7 +137,7 @@ class InformationController extends Controller
private function createDe($data, $information)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title']));
if ($data['content'] == null) {
$data['content'] = 'kosong';
......@@ -155,7 +155,7 @@ class InformationController extends Controller
private function createSa($data, $information)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title']));
if ($data['content'] == null) {
$data['content'] = 'kosong';
......@@ -173,9 +173,9 @@ class InformationController extends Controller
private function createZh($data, $information)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title']));
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
......@@ -252,11 +252,11 @@ class InformationController extends Controller
$request['content_de'] = strip_tags($request->content_de, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['content_sa'] = strip_tags($request->content_sa, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['content_zh'] = strip_tags($request->content_zh, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['title'] = strip_tags($request->title, ['b', 'i', 'u']);
$request['title_en'] = strip_tags($request->title_en, ['b', 'i', 'u']);
$request['title_de'] = strip_tags($request->title_de, ['b', 'i', 'u']);
$request['title_sa'] = strip_tags($request->title_sa, ['b', 'i', 'u']);
$request['title_zh'] = strip_tags($request->title_zh, ['b', 'i', 'u']);
$request['title'] = strip_tags($request->title);
$request['title_en'] = strip_tags($request->title_en);
$request['title_de'] = strip_tags($request->title_de);
$request['title_sa'] = strip_tags($request->title_sa);
$request['title_zh'] = strip_tags($request->title_zh);
$request->validate([
// 'title' => 'required',
......@@ -312,12 +312,12 @@ class InformationController extends Controller
$dataEn['content'] = $data['content_en'];
}
else{
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataEn['title'] = $title;
......@@ -334,12 +334,12 @@ class InformationController extends Controller
$dataDe['content'] = $data['content_de'];
}
else{
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataDe['title'] = $title;
$dataDe['content'] = $content;
......@@ -356,12 +356,12 @@ class InformationController extends Controller
}
else{
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataSa['title'] = $title;
......@@ -379,12 +379,12 @@ class InformationController extends Controller
}
else{
if (strip_tags($data['content']) == null) {
if ($data['content'] == null) {
$data['content'] = 'kosong';
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataZh['title'] = $title;
......
......@@ -81,7 +81,7 @@ class PageController extends Controller
{
// dd($request);
$request['content'] = strip_tags($request->content, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['title'] = strip_tags($request->title, ['b', 'i', 'u']);
$request['title'] = strip_tags($request->title);
$request->validate([
'title' => 'required',
'content' => 'required|min:3',
......@@ -119,7 +119,7 @@ class PageController extends Controller
private function createEn($data, $page)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title']));
if ($data['content'] == null) {
$data['content'] = 'kosong';
......@@ -137,7 +137,7 @@ class PageController extends Controller
private function createDe($data, $page)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title']));
if ($data['content'] == null) {
$data['content'] = 'kosong';
......@@ -155,7 +155,7 @@ class PageController extends Controller
private function createSa($data, $page)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title']));
if ($data['content'] == null) {
$data['content'] = 'kosong';
......@@ -173,7 +173,7 @@ class PageController extends Controller
private function createZh($data, $page)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title']));
if ($data['content'] == null) {
$data['content'] = 'kosong';
......@@ -251,11 +251,11 @@ class PageController extends Controller
$request['content_de'] = strip_tags($request->content_de, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['content_sa'] = strip_tags($request->content_sa, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['content_zh'] = strip_tags($request->content_zh, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['title'] = strip_tags($request->title, ['b', 'i', 'u']);
$request['title_en'] = strip_tags($request->title_en, ['b', 'i', 'u']);
$request['title_de'] = strip_tags($request->title_de, ['b', 'i', 'u']);
$request['title_sa'] = strip_tags($request->title_sa, ['b', 'i', 'u']);
$request['title_zh'] = strip_tags($request->title_zh, ['b', 'i', 'u']);
$request['title'] = strip_tags($request->title);
$request['title_en'] = strip_tags($request->title_en);
$request['title_de'] = strip_tags($request->title_de);
$request['title_sa'] = strip_tags($request->title_sa);
$request['title_zh'] = strip_tags($request->title_zh);
$request->validate([
// 'title' => 'required',
......@@ -312,7 +312,7 @@ class PageController extends Controller
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataEn['title'] = $title;
......@@ -333,7 +333,7 @@ class PageController extends Controller
$data['content'] = 'kosong';
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataDe['title'] = $title;
......@@ -355,7 +355,7 @@ class PageController extends Controller
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataSa['title'] = $title;
......@@ -377,7 +377,7 @@ class PageController extends Controller
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataZh['title'] = $title;
......
......@@ -90,7 +90,7 @@ class PostController extends Controller
{
// dd($request);
$request['content'] = strip_tags($request->content, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['title'] = strip_tags($request->title, ['b', 'i', 'u']);
$request['title'] = strip_tags($request->title);
$request->validate([
'title' => 'required',
'categories' => 'required',
......@@ -227,7 +227,7 @@ class PostController extends Controller
private function createEn($data, $post)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title']));
if ($data['content'] == null) {
$data['content'] = 'kosong';
......@@ -245,7 +245,7 @@ class PostController extends Controller
private function createDe($data, $post)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title']));
if ($data['content'] == null) {
$data['content'] = 'kosong';
......@@ -263,7 +263,7 @@ class PostController extends Controller
private function createSa($data, $post)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title']));
if ($data['content'] == null) {
$data['content'] = 'kosong';
......@@ -281,7 +281,7 @@ class PostController extends Controller
private function createZh($data, $post)
{
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title'], ['b', 'i', 'u']));
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title']));
if ($data['content'] == null) {
$data['content'] = 'kosong';
......@@ -361,11 +361,11 @@ class PostController extends Controller
$request['content_de'] = strip_tags($request->content_de, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['content_sa'] = strip_tags($request->content_sa, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['content_zh'] = strip_tags($request->content_zh, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img']);
$request['title'] = strip_tags($request->title, ['b', 'i', 'u']);
$request['title_en'] = strip_tags($request->title_en, ['b', 'i', 'u']);
$request['title_de'] = strip_tags($request->title_de, ['b', 'i', 'u']);
$request['title_sa'] = strip_tags($request->title_sa, ['b', 'i', 'u']);
$request['title_zh'] = strip_tags($request->title_zh, ['b', 'i', 'u']);
$request['title'] = strip_tags($request->title);
$request['title_en'] = strip_tags($request->title_en);
$request['title_de'] = strip_tags($request->title_de);
$request['title_sa'] = strip_tags($request->title_sa);
$request['title_zh'] = strip_tags($request->title_zh);
$request->validate([
// 'title' => 'required',
......@@ -442,7 +442,7 @@ class PostController extends Controller
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
// dd($title);
$dataEn['title'] = $title;
......@@ -465,7 +465,7 @@ class PostController extends Controller
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataDe['title'] = $title;
$dataDe['content'] = $content;
......@@ -486,7 +486,7 @@ class PostController extends Controller
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataSa['title'] = $title;
$dataSa['content'] = $content;
......@@ -506,7 +506,7 @@ class PostController extends Controller
}
$trans = new GoogleTranslate();
$title = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['title'], ['b', 'i', 'u']));
$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']));
$dataZh['title'] = $title;
$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