From e7763cd273a88e4b99c67e2a74b83ed3ef86727f Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Fri, 17 Jul 2015 08:26:14 +0200 Subject: [PATCH] [ticket/14034] Fix reparser names that contain "text_reparser" in the middle PHPBB3-14034 --- phpBB/phpbb/console/command/reparser/list_all.php | 2 +- phpBB/phpbb/console/command/reparser/reparse.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/phpbb/console/command/reparser/list_all.php b/phpBB/phpbb/console/command/reparser/list_all.php index 1589836ddd..e42c3ac782 100644 --- a/phpBB/phpbb/console/command/reparser/list_all.php +++ b/phpBB/phpbb/console/command/reparser/list_all.php @@ -36,7 +36,7 @@ class list_all extends \phpbb\console\command\command foreach ($reparsers as $name => $reparser) { // Store the names without the "text_reparser." prefix - $this->reparser_names[] = str_replace('text_reparser.', '', $name); + $this->reparser_names[] = preg_replace('(^text_reparser\\.)', '', $name); } } diff --git a/phpBB/phpbb/console/command/reparser/reparse.php b/phpBB/phpbb/console/command/reparser/reparse.php index 151e196358..81d1aa0421 100644 --- a/phpBB/phpbb/console/command/reparser/reparse.php +++ b/phpBB/phpbb/console/command/reparser/reparse.php @@ -149,7 +149,7 @@ class reparse extends \phpbb\console\command\command return; } - $this->io->section($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', str_replace('text_reparser.', '', $name), $min, $max)); + $this->io->section($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', preg_replace('(^text_reparser\\.)', '', $name), $min, $max)); $progress = $this->io->createProgressBar($max); if ($output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE) @@ -171,7 +171,7 @@ class reparse extends \phpbb\console\command\command $progress->setBarWidth(60); } - $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING_START', str_replace('text_reparser.', '', $name))); + $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING_START', preg_replace('(^text_reparser\\.)', '', $name))); if (!defined('PHP_WINDOWS_VERSION_BUILD')) { @@ -189,7 +189,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', str_replace('text_reparser.', '', $name), $start, $end)); + $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', preg_replace('(^text_reparser\\.)', '', $name), $start, $end)); $reparser->reparse_range($start, $end); $current = $start - 1;