diff --git a/_config.php b/_config.php index 40adaa855..c8b68e421 100644 --- a/_config.php +++ b/_config.php @@ -45,7 +45,7 @@ Object::useCustomClass('Datetime','SSDatetime',true); * Add pear parser to include path */ $path = Director::baseFolder().'/sapphire/parsers/'; -set_include_path(get_include_path() . PATH_SEPARATOR . $path); +set_include_path(str_replace('.' . PATH_SEPARATOR, '.' . PATH_SEPARATOR . $path . PATH_SEPARATOR, get_include_path())); /** * Define a default language different than english diff --git a/parsers/HTML/HTMLBBCodeParser.php b/parsers/HTML/HTMLBBCodeParser.php index 6e1bf7b6f..025ff371f 100644 --- a/parsers/HTML/HTMLBBCodeParser.php +++ b/parsers/HTML/HTMLBBCodeParser.php @@ -213,17 +213,20 @@ class SSHTMLBBCodeParser $filter = ucfirst($filter); if (!array_key_exists($filter, $this->_filters)) { $class = 'SSHTMLBBCodeParser_Filter_'.$filter; - @include_once 'BBCodeParser/Filter/'.$filter.'.php'; + if (fopen('BBCodeParser/Filter/'.$filter.'.php','r',true)) { + include_once 'BBCodeParser/Filter/'.$filter.'.php'; + } if (!class_exists($class)) { //PEAR::raiseError("Failed to load filter $filter", null, PEAR_ERROR_DIE); } - - $this->_filters[$filter] = new $class; - $this->_definedTags = array_merge( - $this->_definedTags, - $this->_filters[$filter]->_definedTags - ); + else { + $this->_filters[$filter] = new $class; + $this->_definedTags = array_merge( + $this->_definedTags, + $this->_filters[$filter]->_definedTags + ); + } } }