aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/textformatter/s9e
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-06-10 15:11:27 +0200
committerJoshyPHP <s9e.dev@gmail.com>2015-07-15 22:05:06 +0200
commitda7fc9e5daf6e72f9b86dbc5e002febb202f516e (patch)
treead741d7ad78d93c4a39953e717ab3b01a1896e80 /phpBB/phpbb/textformatter/s9e
parentf1df8e2688bb9765833c18d90302a2f918646929 (diff)
downloadforums-da7fc9e5daf6e72f9b86dbc5e002febb202f516e.tar
forums-da7fc9e5daf6e72f9b86dbc5e002febb202f516e.tar.gz
forums-da7fc9e5daf6e72f9b86dbc5e002febb202f516e.tar.bz2
forums-da7fc9e5daf6e72f9b86dbc5e002febb202f516e.tar.xz
forums-da7fc9e5daf6e72f9b86dbc5e002febb202f516e.zip
[ticket/13935] Allow more admin-configurable schemes in post links
PHPBB3-13935
Diffstat (limited to 'phpBB/phpbb/textformatter/s9e')
-rw-r--r--phpBB/phpbb/textformatter/s9e/factory.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php
index 2aab97b667..4a04b34cd8 100644
--- a/phpBB/phpbb/textformatter/s9e/factory.php
+++ b/phpBB/phpbb/textformatter/s9e/factory.php
@@ -43,6 +43,11 @@ class factory implements \phpbb\textformatter\cache_interface
protected $cache_key_renderer;
/**
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
* @var array Custom tokens used in bbcode.html and their corresponding token from the definition
*/
protected $custom_tokens = array(
@@ -127,16 +132,18 @@ class factory implements \phpbb\textformatter\cache_interface
* @param \phpbb\textformatter\data_access $data_access
* @param \phpbb\cache\driver\driver_interface $cache
* @param \phpbb\event\dispatcher_interface $dispatcher
+ * @param \phpbb\config\config $config
* @param string $cache_dir Path to the cache dir
* @param string $cache_key_parser Cache key used for the parser
* @param string $cache_key_renderer Cache key used for the renderer
*/
- public function __construct(\phpbb\textformatter\data_access $data_access, \phpbb\cache\driver\driver_interface $cache, \phpbb\event\dispatcher_interface $dispatcher, $cache_dir, $cache_key_parser, $cache_key_renderer)
+ public function __construct(\phpbb\textformatter\data_access $data_access, \phpbb\cache\driver\driver_interface $cache, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\config\config $config, $cache_dir, $cache_key_parser, $cache_key_renderer)
{
$this->cache = $cache;
$this->cache_dir = $cache_dir;
$this->cache_key_parser = $cache_key_parser;
$this->cache_key_renderer = $cache_key_renderer;
+ $this->config = $config;
$this->data_access = $data_access;
$this->dispatcher = $dispatcher;
}
@@ -190,6 +197,16 @@ class factory implements \phpbb\textformatter\cache_interface
$vars = array('configurator');
extract($this->dispatcher->trigger_event('core.text_formatter_s9e_configure_before', compact($vars)));
+ // Reset the list of allowed schemes
+ foreach ($configurator->urlConfig->getAllowedSchemes() as $scheme)
+ {
+ $configurator->urlConfig->disallowScheme($scheme);
+ }
+ foreach (explode(',', $this->config['allowed_schemes_links']) as $scheme)
+ {
+ $configurator->urlConfig->allowScheme(trim($scheme));
+ }
+
// Convert newlines to br elements by default
$configurator->rootRules->enableAutoLineBreaks();