mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Merge branch '3.2.x' into 3.3.x
This commit is contained in:
commit
6b5b413025
1 changed files with 23 additions and 2 deletions
|
@ -35,7 +35,7 @@ class parser implements \phpbb\textformatter\parser_interface
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param \phpbb\cache\driver_interface $cache
|
* @param \phpbb\cache\driver\driver_interface $cache
|
||||||
* @param string $key Cache key
|
* @param string $key Cache key
|
||||||
* @param factory $factory
|
* @param factory $factory
|
||||||
* @param \phpbb\event\dispatcher_interface $dispatcher
|
* @param \phpbb\event\dispatcher_interface $dispatcher
|
||||||
|
@ -197,7 +197,9 @@ class parser implements \phpbb\textformatter\parser_interface
|
||||||
public function get_errors()
|
public function get_errors()
|
||||||
{
|
{
|
||||||
$errors = array();
|
$errors = array();
|
||||||
foreach ($this->parser->getLogger()->getLogs() as $entry)
|
$entries = $this->parser->getLogger()->getLogs();
|
||||||
|
|
||||||
|
foreach ($entries as $entry)
|
||||||
{
|
{
|
||||||
list(, $msg, $context) = $entry;
|
list(, $msg, $context) = $entry;
|
||||||
|
|
||||||
|
@ -237,6 +239,25 @@ class parser implements \phpbb\textformatter\parser_interface
|
||||||
$errors = array_map('unserialize', array_unique(array_map('serialize', $errors)));
|
$errors = array_map('unserialize', array_unique(array_map('serialize', $errors)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$parser = $this;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modify error messages generated by the s9e\TextFormatter's logger
|
||||||
|
*
|
||||||
|
* @event core.text_formatter_s9e_get_errors
|
||||||
|
* @var parser parser This parser service
|
||||||
|
* @var array entries s9e\TextFormatter's logger entries
|
||||||
|
* @var array errors Error arrays with language key and optional arguments
|
||||||
|
* @since 3.2.10-RC1
|
||||||
|
* @since 3.3.1-RC1
|
||||||
|
*/
|
||||||
|
$vars = [
|
||||||
|
'parser',
|
||||||
|
'entries',
|
||||||
|
'errors',
|
||||||
|
];
|
||||||
|
extract($this->dispatcher->trigger_event('core.text_formatter_s9e_get_errors', compact($vars)));
|
||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue