aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/console/command/reparser/list_all.php4
-rw-r--r--phpBB/phpbb/console/command/reparser/reparse.php16
-rw-r--r--phpBB/phpbb/cron/task/text_reparser/reparser.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/increase_size_of_emotion.php46
-rw-r--r--phpBB/phpbb/extension/metadata_manager.php3
-rw-r--r--phpBB/phpbb/plupload/plupload.php2
-rw-r--r--phpBB/phpbb/textreparser/base.php27
-rw-r--r--phpBB/phpbb/textreparser/manager.php20
-rw-r--r--phpBB/phpbb/textreparser/reparser_interface.php14
9 files changed, 118 insertions, 16 deletions
diff --git a/phpBB/phpbb/console/command/reparser/list_all.php b/phpBB/phpbb/console/command/reparser/list_all.php
index 028468649d..a79578abf0 100644
--- a/phpBB/phpbb/console/command/reparser/list_all.php
+++ b/phpBB/phpbb/console/command/reparser/list_all.php
@@ -34,10 +34,10 @@ class list_all extends \phpbb\console\command\command
{
parent::__construct($user);
$this->reparser_names = array();
- foreach ($reparsers as $name => $reparser)
+ foreach ($reparsers as $reparser)
{
// Store the names without the "text_reparser." prefix
- $this->reparser_names[] = preg_replace('(^text_reparser\\.)', '', $name);
+ $this->reparser_names[] = $reparser->get_name();
}
}
diff --git a/phpBB/phpbb/console/command/reparser/reparse.php b/phpBB/phpbb/console/command/reparser/reparse.php
index cebeee0919..f285977ea2 100644
--- a/phpBB/phpbb/console/command/reparser/reparse.php
+++ b/phpBB/phpbb/console/command/reparser/reparse.php
@@ -140,13 +140,9 @@ class reparse extends \phpbb\console\command\command
}
$name = $input->getArgument('reparser-name');
- if (isset($name))
+ if ($name)
{
- // Allow "post_text" to be an alias for "text_reparser.post_text"
- if (!isset($this->reparsers[$name]))
- {
- $name = 'text_reparser.' . $name;
- }
+ $name = $this->reparser_manager->find_reparser($name);
$this->reparse($name);
}
else
@@ -187,7 +183,7 @@ class reparse extends \phpbb\console\command\command
/**
* Reparse all text handled by given reparser within given range
*
- * @param string $name Reparser name
+ * @param string $name Reparser service name
*/
protected function reparse($name)
{
@@ -218,10 +214,10 @@ class reparse extends \phpbb\console\command\command
return;
}
- $this->io->section($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', preg_replace('(^text_reparser\\.)', '', $name), $min, $max));
+ $this->io->section($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', $reparser->get_name(), $min, $max));
$progress = $this->create_progress_bar($max, $this->io, $this->output, true);
- $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING_START', preg_replace('(^text_reparser\\.)', '', $name)));
+ $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING_START', $reparser->get_name()));
$progress->start();
// Start from $max and decrement $current by $size until we reach $min
@@ -231,7 +227,7 @@ class reparse extends \phpbb\console\command\command
$start = max($min, $current + 1 - $size);
$end = max($min, $current);
- $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', preg_replace('(^text_reparser\\.)', '', $name), $start, $end));
+ $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', $reparser->get_name(), $start, $end));
$reparser->reparse_range($start, $end);
$current = $start - 1;
diff --git a/phpBB/phpbb/cron/task/text_reparser/reparser.php b/phpBB/phpbb/cron/task/text_reparser/reparser.php
index 7099128efd..69392f5ac9 100644
--- a/phpBB/phpbb/cron/task/text_reparser/reparser.php
+++ b/phpBB/phpbb/cron/task/text_reparser/reparser.php
@@ -81,7 +81,7 @@ class reparser extends \phpbb\cron\task\base
*/
public function set_reparser($reparser)
{
- $this->reparser_name = (!isset($this->reparsers[$reparser]) ? 'text_reparser.' : '') . $reparser;
+ $this->reparser_name = !isset($this->reparsers[$reparser]) ? $this->reparser_manager->find_reparser($reparser) : $reparser;
if ($this->resume_data === null)
{
diff --git a/phpBB/phpbb/db/migration/data/v31x/increase_size_of_emotion.php b/phpBB/phpbb/db/migration/data/v31x/increase_size_of_emotion.php
new file mode 100644
index 0000000000..7e486aca7c
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/increase_size_of_emotion.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class increase_size_of_emotion extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v3110',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'smilies' => array(
+ 'emotion' => array('VCHAR_UNI', ''),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'smilies' => array(
+ 'emotion' => array('VCHAR_UNI:50', ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php
index fe64c92ee1..2b8b1bbd6a 100644
--- a/phpBB/phpbb/extension/metadata_manager.php
+++ b/phpBB/phpbb/extension/metadata_manager.php
@@ -102,8 +102,9 @@ class metadata_manager
return $this->metadata;
break;
+ case 'version':
case 'name':
- return ($this->validate('name')) ? $this->metadata['name'] : false;
+ return ($this->validate($element)) ? $this->metadata[$element] : false;
break;
case 'display-name':
diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php
index a47fc87adf..eb698fb35d 100644
--- a/phpBB/phpbb/plupload/plupload.php
+++ b/phpBB/phpbb/plupload/plupload.php
@@ -266,7 +266,7 @@ class plupload
if ($this->config['img_max_height'] > 0 && $this->config['img_max_width'] > 0)
{
$resize = sprintf(
- 'resize: {width: %d, height: %d, quality: 100},',
+ 'resize: {width: %d, height: %d, quality: 85},',
(int) $this->config['img_max_width'],
(int) $this->config['img_max_height']
);
diff --git a/phpBB/phpbb/textreparser/base.php b/phpBB/phpbb/textreparser/base.php
index afa5ccacad..27d7bc1f27 100644
--- a/phpBB/phpbb/textreparser/base.php
+++ b/phpBB/phpbb/textreparser/base.php
@@ -16,6 +16,11 @@ namespace phpbb\textreparser;
abstract class base implements reparser_interface
{
/**
+ * @var string The reparser name
+ */
+ protected $name;
+
+ /**
* @var bool Whether to save changes to the database
*/
protected $save_changes = true;
@@ -90,6 +95,26 @@ abstract class base implements reparser_interface
}
/**
+ * Returns the name of the reparser
+ *
+ * @return string Name of reparser
+ */
+ public function get_name()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Sets the name of the reparser
+ *
+ * @param string $name The reparser name
+ */
+ public function set_name($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
* Disable saving changes to the database
*/
public function disable_save()
@@ -231,7 +256,7 @@ abstract class base implements reparser_interface
$unparsed['enable_flash_bbcode'],
$unparsed['enable_quote_bbcode'],
$unparsed['enable_url_bbcode'],
- 'reparse'
+ 'text_reparser.' . $this->get_name()
);
// Save the new text if it has changed and it's not a dry run
diff --git a/phpBB/phpbb/textreparser/manager.php b/phpBB/phpbb/textreparser/manager.php
index fddd867923..7ca65d708d 100644
--- a/phpBB/phpbb/textreparser/manager.php
+++ b/phpBB/phpbb/textreparser/manager.php
@@ -125,4 +125,24 @@ class manager
$this->schedule($reparser, $interval);
}
}
+
+ /**
+ * Finds a reparser by name.
+ *
+ * If there is no reparser with the specified name, null is returned.
+ *
+ * @param string $name Name of the reparser to look up.
+ * @return string A reparser service name, or null.
+ */
+ public function find_reparser($name)
+ {
+ foreach ($this->reparsers as $service => $reparser)
+ {
+ if ($reparser->get_name() == $name)
+ {
+ return $service;
+ }
+ }
+ return null;
+ }
}
diff --git a/phpBB/phpbb/textreparser/reparser_interface.php b/phpBB/phpbb/textreparser/reparser_interface.php
index 9ea1732870..912de10058 100644
--- a/phpBB/phpbb/textreparser/reparser_interface.php
+++ b/phpBB/phpbb/textreparser/reparser_interface.php
@@ -23,6 +23,20 @@ interface reparser_interface
public function get_max_id();
/**
+ * Returns the name of the reparser
+ *
+ * @return string Name of reparser
+ */
+ public function get_name();
+
+ /**
+ * Sets the name of the reparser
+ *
+ * @param string $name The reparser name
+ */
+ public function set_name($name);
+
+ /**
* Reparse all records in given range
*
* @param integer $min_id Lower bound