public function filterData($data)
 {
     if (!empty($data['text'])) {
         $model = new EditHubModel();
         $data['text'] = strip_tags($data['text'], $model->getAllowedTags());
     }
     if (!empty($data['imageLink'])) {
         $data['imageLink'] = $this->addProtocolToLink($data['imageLink']);
     }
     return parent::filterData($data);
 }
 public function filterData($data)
 {
     $data = parent::filterData($data);
     $model = new WikiaHubsSliderModel();
     $slidesCount = $model->getSlidesCount();
     for ($i = 1; $i <= $slidesCount; $i++) {
         if (!empty($data['url' . $i])) {
             $data['url' . $i] = $this->addProtocolToLink($data['url' . $i]);
         }
     }
     return $data;
 }
 public function filterData($data)
 {
     $data = parent::filterData($data);
     //for now we're allowing to save empty videos' list
     if (!isset($data['video'])) {
         $data['video'] = array();
     }
     if (!isset($data['videoUrl'])) {
         $data['videoUrl'] = array();
     }
     foreach ($data['videoUrl'] as &$url) {
         if (!empty($url)) {
             $url = $this->addProtocolToLink($url);
         }
     }
     return $data;
 }
 public function filterData($data)
 {
     $data = parent::filterData($data);
     for ($sectionIdx = 1; $sectionIdx <= $this->sectionsLimit; $sectionIdx++) {
         for ($linkIdx = 0; $linkIdx < $this->linksLimit; $linkIdx++) {
             $urlFieldName = $this->generateUrlFieldName($sectionIdx, $linkIdx);
             if (!empty($data[$urlFieldName])) {
                 $data[$urlFieldName] = $this->addProtocolToLink($data[$urlFieldName]);
             }
         }
     }
     if (!empty($data['imageLink'])) {
         $data['imageLink'] = $this->addProtocolToLink($data['imageLink']);
     }
     return $data;
 }
 public function filterData($data)
 {
     $data = parent::filterData($data);
     $boxesCount = $this->getModel()->getBoxesCount();
     for ($i = 1; $i <= $boxesCount; $i++) {
         if (!empty($data[self::FIELD_NAME_URL . $i])) {
             $data[self::FIELD_NAME_URL . $i] = $this->addProtocolToLink($data[self::FIELD_NAME_URL . $i]);
         }
         if (!empty($data[self::FIELD_NAME_USERSURL . $i])) {
             $data['usersUrl' . $i] = $this->addProtocolToLink($data[self::FIELD_NAME_USERSURL . $i]);
             // get Wiki URL
             $parsedUrl = parse_url($data[self::FIELD_NAME_USERSURL . $i]);
             $data['wikiUrl' . $i] = $parsedUrl['host'];
             $userName = UserService::getNameFromUrl($data[self::FIELD_NAME_USERSURL . $i]);
             if ($userName !== false) {
                 $data['UserName' . $i] = $userName;
             }
         }
         if (!empty($data[self::FIELD_NAME_QUOTE . $i])) {
             $model = new EditHubModel();
             $data[self::FIELD_NAME_QUOTE . $i] = strip_tags($data[self::FIELD_NAME_QUOTE . $i], $model->getAllowedTags());
         }
     }
     return $data;
 }