/** * Remove specified BBCodes and their contents * * @return string Stripped message text */ protected function process() { foreach ($this->data as $bbcode) { $this->text = $this->text_formatter_utils->remove_bbcode($this->text, $bbcode); } return $this->text_formatter_utils->unparse($this->text); }
/** * Get content for display * * @param bool $censor_text True to censor the text (Default: true) * @return string * @access public */ public function get_content_for_display($censor_text = true) { // If these haven't been set yet; use defaults $content = isset($this->data['page_content']) ? $this->data['page_content'] : ''; $uid = isset($this->data['page_content_bbcode_uid']) ? $this->data['page_content_bbcode_uid'] : ''; $bitfield = isset($this->data['page_content_bbcode_bitfield']) ? $this->data['page_content_bbcode_bitfield'] : ''; $options = isset($this->data['page_content_bbcode_options']) ? (int) $this->data['page_content_bbcode_options'] : 0; $content_html_enabled = $this->content_html_enabled(); $route = $this->get_route(); // Generate for display if ($content_html_enabled) { // This is required by s9e text formatter to // remove extra xml formatting from the content. if ($this->text_formatter_utils !== null) { $content = $this->text_formatter_utils->unparse($content); } $content = htmlspecialchars_decode($content, ENT_COMPAT); } else { $content = generate_text_for_display($content, $uid, $bitfield, $options, $censor_text); } /** * Event to modify page content * * @event phpbb.pages.modify_content_for_display * @var string content Page content * @var string route Page route * @var string uid Page content bbcode uid * @var string bitfield Page content bbcode bitfield * @var int options Page content bbcode options * @var bool content_html_enabled Is HTML allowed in page content * @since 1.0.0-RC1 */ $vars = array('content', 'route', 'uid', 'bitfield', 'options', 'content_html_enabled'); extract($this->dispatcher->trigger_event('phpbb.pages.modify_content_for_display', compact($vars))); return $content; }