Skip to content

Commit

Permalink
Merge branch 'master' into release-1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
iMattPro committed Jun 14, 2015
2 parents aee368e + 421e60e commit 7a12df4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"extra": {
"display-name": "Pages",
"soft-require": {
"phpbb/phpbb": ">=3.1.3,<3.2.*@dev"
"phpbb/phpbb": ">=3.1.3,<3.3.*@dev"
},
"version-check": {
"host": "www.phpbb.com",
Expand Down
1 change: 1 addition & 0 deletions config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ services:
- @config
- @dispatcher
- %phpbb.pages.tables.pages%
- @?text_formatter.utils # optional to allow bc with phpBB 3.1

phpbb.pages.operator:
class: phpbb\pages\operators\page
Expand Down
22 changes: 17 additions & 5 deletions entity/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class page implements page_interface
/** @var \phpbb\event\dispatcher_interface */
protected $phpbb_dispatcher;

/** @var \phpbb\textformatter\s9e\utils */
protected $text_formatter_utils;

/**
* The database table the page data is stored in
*
Expand All @@ -55,18 +58,20 @@ class page implements page_interface
/**
* Constructor
*
* @param \phpbb\db\driver\driver_interface $db Database object
* @param \phpbb\config\config $config Config object
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher
* @param string $pages_table Name of the table used to store page data
* @param \phpbb\db\driver\driver_interface $db Database object
* @param \phpbb\config\config $config Config object
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher
* @param string $pages_table Name of the table used to store page data
* @param \phpbb\textformatter\s9e\utils $text_formatter_utils Text manipulation utilities
* @access public
*/
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\event\dispatcher_interface $phpbb_dispatcher, $pages_table)
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\event\dispatcher_interface $phpbb_dispatcher, $pages_table, \phpbb\textformatter\s9e\utils $text_formatter_utils = null)
{
$this->db = $db;
$this->config = $config;
$this->dispatcher = $phpbb_dispatcher;
$this->pages_table = $pages_table;
$this->text_formatter_utils = $text_formatter_utils;
}

/**
Expand Down Expand Up @@ -511,6 +516,13 @@ public function get_content_for_display($censor_text = true)
// 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
Expand Down

0 comments on commit 7a12df4

Please sign in to comment.