Пример #1
0
 /**
  * Just in case you can't figure the method name out: this cleans the left-over junk
  */
 function cleanLeftoverJunk(&$str)
 {
     NNProtect::removeInlineComments($str, 'Tooltips');
 }
Пример #2
0
 function onAfterRender()
 {
     // only in html and feeds
     if (JFactory::getDocument()->getType() !== 'html' && ($this->params->protect_in_feeds && JFactory::getDocument()->getType() !== 'feed')) {
         return;
     }
     $html = JResponse::getBody();
     if ($html == '') {
         return;
     }
     // only do stuff in body
     list($pre, $body, $post) = nnText::getBody($html);
     $this->protectEmails($body);
     $html = $pre . $body . $post;
     if (JFactory::getDocument()->getType() == 'html') {
         if (strpos($html, 'addCloakedMailto') === false) {
             // remove style and script if no emails are found
             $html = preg_replace('#/\\* START: ' . $this->name . ' .*?/\\* END: ' . $this->name . ' [a-z]* \\*/\\s*#s', '', $html);
         } else {
             // correct attribut ids in possible cached modules/content
             $html = preg_replace('# data-ep-a[a-z0-9]{4}=#s', ' ' . $this->params->atrr_pre . '=', $html);
             $html = preg_replace('# data-ep-b[a-z0-9]{4}=#s', ' ' . $this->params->atrr_post . '=', $html);
             NNProtect::removeInlineComments($html, $this->name);
         }
     }
     JResponse::setBody($html);
 }