Exemple #1
0
 /**
  * Load EasyBlog's ACL
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public static function acl($userId = '')
 {
     static $acl = array();
     if (!$userId) {
         $userId = JFactory::getuser()->id;
     }
     if (!isset($acl[$userId])) {
         require_once dirname(__FILE__) . '/acl/acl.php';
         $acl[$userId] = EasyBlogAcl::getRuleSet($userId);
     }
     return $acl[$userId];
 }
Exemple #2
0
 /**
  * Given a set of content, filter the content by normalizing the content
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function filterHtml($content = '')
 {
     static $filter;
     static $filterType;
     // If filter hasn't been initialized before, do it now.
     if (!isset($filter)) {
         jimport('joomla.filter.filterinput');
         // Get tags & attributes that should be stripped.
         $filterTags = EasyBlogAcl::getFilterTags();
         $filterAttrs = EasyBlogAcl::getFilterAttributes();
         $filterType = 'html';
         // Create filter instance.
         $filter = JFilterInput::getInstance($filterTags, $filterAttrs, 1, 1, 0);
         $filter->tagBlacklist = $filterTags;
         $filter->attrBlacklist = $filterAttrs;
         // Disable filtering if there's nothing to filter
         if (count($filterTags) < 1 && count($filterAttrs) < 1) {
             $filter = false;
         }
     }
     // If we can skip filtering, just return content.
     if ($filter == false) {
         return $content;
     }
     // Strip blacklisted tags & attributes.
     return $filter->clean($content, $filterType);
 }