Commit a5750856 by Triyah Fatmawati

Allow span

parent 5d45f4a2
...@@ -79,7 +79,7 @@ class PageController extends Controller ...@@ -79,7 +79,7 @@ class PageController 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', 'td', 'th', 'tr', 'iframe','section','small','button']); $request['content'] = strip_tags($request->content, ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']);
$request['title'] = strip_tags($request->title); $request['title'] = strip_tags($request->title);
$request->validate([ $request->validate([
'title' => 'required', 'title' => 'required',
...@@ -121,7 +121,7 @@ class PageController extends Controller ...@@ -121,7 +121,7 @@ class PageController 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', 'td', 'th', 'tr', 'iframe','section','small','button'])); $content = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['content'], ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']));
$dataEn['page_id'] = $page->id; $dataEn['page_id'] = $page->id;
$dataEn['title'] = $title; $dataEn['title'] = $title;
...@@ -139,7 +139,7 @@ class PageController extends Controller ...@@ -139,7 +139,7 @@ class PageController 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', 'td', 'th', 'tr', 'iframe','section','small','button'])); $content = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['content'], ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']));
$dataDe['page_id'] = $page->id; $dataDe['page_id'] = $page->id;
$dataDe['title'] = $title; $dataDe['title'] = $title;
...@@ -157,7 +157,7 @@ class PageController extends Controller ...@@ -157,7 +157,7 @@ class PageController 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', 'td', 'th', 'tr', 'iframe','section','small','button'])); $content = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['content'], ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']));
$dataSa['page_id'] = $page->id; $dataSa['page_id'] = $page->id;
$dataSa['title'] = $title; $dataSa['title'] = $title;
...@@ -175,7 +175,7 @@ class PageController extends Controller ...@@ -175,7 +175,7 @@ class PageController 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', 'td', 'th', 'tr', 'iframe','section','small','button'])); $content = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['content'], ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']));
$dataZh['page_id'] = $page->id; $dataZh['page_id'] = $page->id;
$dataZh['title'] = $title; $dataZh['title'] = $title;
...@@ -241,11 +241,11 @@ class PageController extends Controller ...@@ -241,11 +241,11 @@ class PageController 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', 'td', 'th', 'tr', 'iframe','section','small','button']); $request['content'] = strip_tags($request->content, ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']);
$request['content_en'] = strip_tags($request->content_en, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button']); $request['content_en'] = strip_tags($request->content_en, ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']);
$request['content_de'] = strip_tags($request->content_de, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button']); $request['content_de'] = strip_tags($request->content_de, ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']);
$request['content_sa'] = strip_tags($request->content_sa, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button']); $request['content_sa'] = strip_tags($request->content_sa, ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']);
$request['content_zh'] = strip_tags($request->content_zh, ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button']); $request['content_zh'] = strip_tags($request->content_zh, ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button','span']);
$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);
...@@ -294,7 +294,7 @@ class PageController extends Controller ...@@ -294,7 +294,7 @@ class PageController 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', 'td', 'th', 'tr', 'iframe','section','small','button']); $dataEn['content'] = strip_tags($data['content_en'], ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']);
} }
else{ else{
if ($data['content'] == null) { if ($data['content'] == null) {
...@@ -304,7 +304,7 @@ class PageController extends Controller ...@@ -304,7 +304,7 @@ class PageController 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']));
if (strlen($data['content']) < 5000) { if (strlen($data['content']) < 5000) {
$content = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button'])); $content = $trans->translate($this->SOURCE, $this->TARGET, strip_tags($data['content'], ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']));
$dataEn['content'] = $content; $dataEn['content'] = $content;
} }
$dataEn['title'] = $title; $dataEn['title'] = $title;
...@@ -317,7 +317,7 @@ class PageController extends Controller ...@@ -317,7 +317,7 @@ class PageController 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', 'td', 'th', 'tr', 'iframe','section','small','button']); $dataDe['content'] = strip_tags($data['content_de'], ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']);
} }
else{ else{
if($data['content']==null){ if($data['content']==null){
...@@ -326,7 +326,7 @@ class PageController extends Controller ...@@ -326,7 +326,7 @@ class PageController 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']));
if (strlen($data['content']) < 5000) { if (strlen($data['content']) < 5000) {
$content = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button'])); $content = $trans->translate($this->SOURCE, $this->TARGETDE, strip_tags($data['content'], ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']));
$dataDe['content'] = $content; $dataDe['content'] = $content;
} }
$dataDe['title'] = $title; $dataDe['title'] = $title;
...@@ -339,7 +339,7 @@ class PageController extends Controller ...@@ -339,7 +339,7 @@ class PageController 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', 'td', 'th', 'tr', 'iframe','section','small','button']); $dataSa['content'] = strip_tags($data['content_sa'], ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']);
} }
else{ else{
if($data['content']==null){ if($data['content']==null){
...@@ -349,7 +349,7 @@ class PageController extends Controller ...@@ -349,7 +349,7 @@ class PageController 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']));
if (strlen($data['content']) < 5000) { if (strlen($data['content']) < 5000) {
$content = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button'])); $content = $trans->translate($this->SOURCE, $this->TARGETSA, strip_tags($data['content'], ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']));
$dataSa['content'] = $content; $dataSa['content'] = $content;
} }
$dataSa['title'] = $title; $dataSa['title'] = $title;
...@@ -362,7 +362,7 @@ class PageController extends Controller ...@@ -362,7 +362,7 @@ class PageController 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', 'td', 'th', 'tr', 'iframe','section','small','button']); $dataZh['content'] = strip_tags($data['content_zh'],['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']);
} }
else{ else{
if($data['content']==null){ if($data['content']==null){
...@@ -372,7 +372,7 @@ class PageController extends Controller ...@@ -372,7 +372,7 @@ class PageController 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']));
if (strlen($data['content']) < 5000) { if (strlen($data['content']) < 5000) {
$content = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['content'], ['a', 'br', 'p', 'b', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button'])); $content = $trans->translate($this->SOURCE, $this->TARGETZH, strip_tags($data['content'], ['a', 'br', 'p', '<b>', 'i', 'u', 'ul', 'li', 'ol', 'img', 'table', 'td', 'th', 'tr', 'iframe','section','small','button', 'span']));
$dataZh['content'] = $content; $dataZh['content'] = $content;
} }
$dataZh['title'] = $title; $dataZh['title'] = $title;
......
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