/**
  * Mangles links to have ad tracking vars
  */
 protected function transformText($text)
 {
     // prepend uris with base href
     $text = preg_replace('/:uri:(.*?)(\\s)/', $this->getBaseHref() . '\\1\\2', $text);
     if (mb_detect_encoding($text, 'UTF-8', true) !== 'UTF-8') {
         throw new SiteException('Text output is not valid UTF-8');
     }
     $text = SwatString::stripXHTMLTags($text);
     $text = html_entity_decode($text);
     return $text;
 }
Exemple #2
0
 /**
  * Finalizes the page title displayed in the HTML head
  */
 protected function finalizeHtmlTitle()
 {
     $site_title = $this->app->config->site->title;
     $page_title = SwatString::stripXHTMLTags($this->data->title);
     if ($page_title != '') {
         $this->data->html_title = sprintf('%s - %s', SwatString::minimizeEntities($page_title), SwatString::minimizeEntities($site_title));
     } elseif ($this->data->html_title != '') {
         $this->data->html_title .= sprintf(' - %s', SwatString::minimizeEntities($site_title));
     } else {
         $this->data->html_title = SwatString::minimizeEntities($site_title);
     }
 }