Przeglądaj źródła

set category and type to always be string

ksieren 2 lat temu
rodzic
commit
b241501cf9
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      Classes/Controller/SimpleController.php

+ 4 - 0
Classes/Controller/SimpleController.php

@@ -27,9 +27,13 @@ class SimpleController extends ActionController
     public function persistDataToDBAction($termsList, $category, $type, $url){
     public function persistDataToDBAction($termsList, $category, $type, $url){
         if(!($category === '') && !($category === null)){
         if(!($category === '') && !($category === null)){
             $category = ($this->categoryRepository->findByUid($category))->getTitle();
             $category = ($this->categoryRepository->findByUid($category))->getTitle();
+        } else {
+            $category = '';
         }
         }
         if(!($type === '') && !($type === null)){
         if(!($type === '') && !($type === null)){
             $type = ($this->typeRepository->findByUid($type))->getTitle();
             $type = ($this->typeRepository->findByUid($type))->getTitle();
+        } else {
+            $type = '';
         }
         }
         if($url === null){
         if($url === null){
             $url = '';
             $url = '';